diff -ruN a/src/srvloc.c b/src/srvloc.c --- a/src/srvloc.c 2022-09-08 21:53:25.455053569 +0200 +++ b/src/srvloc.c 2022-09-08 22:07:54.489137678 +0200 @@ -229,9 +229,14 @@ res[j].weight = ntohs(*(uint16_t *)(rr.rdata + 2)); res[j].port = ntohs(*(uint16_t *)(rr.rdata + 4)); memcpy(res[j].host, rr.rdata + 6, rr.rdlength - 6); - if (ns_name_ntop(rr.rdata + 6, res[j].host, answer_len) == -1) { - continue; + //if (ns_name_ntop(rr.rdata + 6, res[j].host, answer_len) == -1) { + // continue; + //} + if (ns_name_uncompress(ns_msg_base(msg), ns_msg_end(msg), + rr.rdata + 6, res[j].host, sizeof(res[j].host))) { + continue; } + res[j].host[answer_len] = '\0'; j++; }