mDNS on a fresh NetBSD 7.0.1 install

Posted on June 27, 2016

Resolving local network hosts by name is even more fun on NetBSD than is on FreeBSD. There’s some confusion as to what should go into nsswitch.conf, but thankfully @RadoslawKujawa has a piece up that cuts through the all crap.

Assuming you’ve just installed NetBSD for the first time, log in as root and

  1. Enable the multicast and unicast DNS daemon: mdnsd(8) $ echo "mdnsd=YES" >> /etc/rc.conf

  2. Add a source named “msdnsd” to the hosts database in nsswitch.conf(5) $ sed 's|^\(hosts.*\)files dns|\1files dns mdnsd|g' /etc/nsswitch.conf

  3. Restart mdnsd(8) $ /etc/rc.d/mdnsd restart

  4. Test $ getent hosts <another mdns responding host on your lan>.local $ ping <another mdns responding host on your lan>.local

mdns works