Monday, July 11, 2016

How To setup mDNS on Slackware

mDNS is tool for finding computers and services, such printers, shares, devices, etc. on your local network without having to set up DNS etc. first.

1. Download the Slackware mDNS package from here:

2. unzip the package:
gzip -d nss-mdns-0.10.tar.gz

Remember to substitute your packages version number in place of "0.10" if it is different.

3. unarchive the files into a directory:
tar -xvf nss-mdns-0.10.tar

Again, remember to substitute your own package version.

Now we need to configure the package for your Slackware system and then build it and install it.

4. Configure the package:
cd nss-mdns-0.10


Note, if you don't have Avahi, then you will need to use the mini mDNS stack like this:

./configure -enable-legacy

5. next build the package:


6. next install the package as root:

<enter your root password>

make install

7. Now we need to add some things to our /etc/nsswitch.conf file:
pico /etc/nsswitch.conf

change the line that start with the word "hosts:" to this:
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

This means look for a hostname in the hosts file, then if it ends in.local, try mDNS and give up if not found. If it didn't end in .local, try the normal DNS services and finally try mDNS.

Done. Now we can test it quickly by using the getent command:

getent <name>.local

replace <name> with the name of a service registered with an mDNSResponder (like a Windows PC with iTunes running on it).

This will return the IP address of the host.

If you have a firewall in your local network, set it up to allow UDP traffic to the the mDNS multicast address on port 5353.


Post a Comment

<< Home