core: compute the len for dns srv name

- fixes dns srv for cache, reported by Rob Eijgenraam, FS#426

(cherry picked from commit b834cde74f8a4b41ec24ceb8332adff8bb3922bb)