Closed troglobit closed 6 years ago
From #14:
The address selection criteria you propose seem obvious, i.e. prefer a global address over link-local. Possibly there is a way to announce all (IPv4) addresses, but I don't know yet.
I think you can add multiple A-records (same name, one for each address) to a DNS query response. I was thinking they could be weighted but that's only for MX. One would hope the recipient OS will pick the one which it can route to. Seems like it would be easy to test in any case.
Aha, that's really useful info thanks!
There's a possible fix on the improve-a-record-support
.. slightly misrepresentative branch name, but there are two fixes relevant to your case. Hopefully 06c0df8 does at least the bare minimum of what you need.
I haven't merged it to master yet because I wanted to give you a chance to review it first. Please let me know if it's to your liking.
Fantastic, I'll give it a try in the morning and update once I do. Thanks!
I've been playing around with this all morning - 06c0df8 looks good! I get a global
address when I'm on a DHCP network and I can hotplug the ethernet between link-local and DHCP LAN, meanwhile mdnsd
handles the network changes gracefully without restarting or poking the process. Brilliant! 🎉
Great news, thank you so much for testing this! :heart:
Then I can proceed to merge and prepare the last steps of the v0.8 release :smiley:
@thom-nic An official v0.8 is released now. Thank you for all your invaluable help and encouraging conversation! :smiley:
As reported by @thom-nic in https://github.com/troglobit/mdnsd/issues/14#issuecomment-413626567, mdnsd picks the first address returned by
getaddrinfo()
and happily runs even when the (any) interface still hasn't got a valid address.As @thom-nic points out, announcing mDNS records with address 0.0.0.0 is not ideal since it'll take the TTL before they expire.