Refactoring mdns to reduce the amount of dns-native hacking.