Why doesn't DnsServiceRegister create mDNS A/AAAA records?

Sameer Puri 0 Reputation points
2025-06-03T06:27:36.3333333+00:00

Hello,

I am trying to register a DNS-SD service using the win32 APIs. When I call DnsServiceRegister with valid IPv4 and IPv6 addresses, I don't see these addresses broadcasted by the system. I inspected the mDNS traffic with Wireshark and I only see PTR/SRV records for my service. Relatedly, my register completion callback reports that the service is successfully registered, but the IPv4 and IPv6 fields in the DNS service instance passed to the callback are both null.

Using the system hostname does work because there are already A/AAAA records for that. However, a custom hostname has no records because DnsServiceRegister doesn't seem to consider the ones I passed in.

I verified that the service name, host name, port and other fields were all valid so I'm not sure what I'm missing. Are there some logs I can check?

Windows development | Windows API - Win32

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.