Saturday, December 24, 2005

Success with bonjour mdns on Fedora

I have 2 Fedora boxes, one is called vivo, another is called lap (yes it's my imaginatively named laptop). I have a small network at home to allow these and some other computers to communicate. Since none of them are turned on all of the time, I can't run a DNS server and I've had to hard code hostnames and IPs into /etc/hosts.

There is something called bonjour which is supposed to do away with this kind of messing. Fedora 3 and 4 come with a package called howl containing mnds stuff which is exactly for this. So for example, a Mac user on my network could find my Fedora machines without having to ask a dns servers. They could just call them vivo.local and lap.local and the names would be translated to the correct ip address.

Sadly Fedora itself only comes with the server side of things so a Fedora machine cannot translate vivo.local into the correct ip address. Trying to ssh to vivo.local from my laptop gives me a host not found error.

This seemed a bit silly and after quite a bit of searching all I could find was Ulrich Drepper explaining that other distros had this functionality but that it is a "terribly ugly hack which is beyond wrong". That was more than a year ago and Fedora still doesn't have this.

After a bit more seaching I found Avahi a fully Free implementation of the server side of things. Presumably this will replace Howl which is Fedora's current implementation but is not quite as Free.

Reading about Avahi I finally found nss-mdns which does exactly what I want. It's a breeze to compile and setup and it just works. Now my Fedora boxes can call each other by their names with no need to run a DNS server and no need to edit /etc/hosts. Cool.

I have no idea if this is the "ugly hack" that other distros use or what but please Fedora, please get it together and add mdns resolution to FC 5 (hell, add it to FC 3 and 4 it's so easy).

To get it going, download and untar the source and then in the untarred directory ./configure --disable-avahi, make and make install. Then edit /etc/nsswitch.conf as described on the nss-mdns homepage. That's it, if only everything was so easy.

The only problem I encountered was that Fedora's firewall is blocking port 5335. I must admit that I just knocked of the firewall to get it working. I'll fix that up after.

Post a Comment