RFC 6762 says:
In multicast query messages, the Query Identifier SHOULD be set to zero on transmission.
However, this library seems to let miekg/dns pick up the random generated identifier by default.
FWIW, Apple's mDNSRespoder actually checks the ID with a macro mDNSOpaque16IsZero() everywhere, so this library doesn't work reliably with it.
And systemd-resolved agrees with this:
https://github.com/systemd/systemd/blob/main/src/resolve/resolved-dns-scope.c#L1236
You can let miekg/dns use zero identifier by the following:
dns.Id = func () uint16 { return 0 }
RFC 6762 says:
However, this library seems to let miekg/dns pick up the random generated identifier by default.
FWIW, Apple's mDNSRespoder actually checks the ID with a macro mDNSOpaque16IsZero() everywhere, so this library doesn't work reliably with it.
And systemd-resolved agrees with this:
https://github.com/systemd/systemd/blob/main/src/resolve/resolved-dns-scope.c#L1236
You can let miekg/dns use zero identifier by the following: