Avahi on Breezy

During conferences, it is often useful to be able to connect to connect to other people’s machines (e.g. for collaborative editing sessions with Gobby). This is a place where mDNS hostname resolution can come in handy, so you don’t need to remember IP addresses.

This is quite easy to set up on Breezy:

  • Install the avahi-daemon, avahi-utils and libnss-mdns packages from universe.
  • Restart dbus in order for the new system bus security policies to take effect with “sudo invoke-rc.d dbus restart“.
  • Start avahi-daemon with “sudo invoke-rc.d avahi-daemon start“.
  • Edit /etc/nsswitch.conf, and add “mdns” to the end of the “hosts:” line.

Now your hostname should be advertised to the local network, and you can connect to other hosts by name (of the form hostname.local). You can also get a list of the currently advertised hosts and services with the avahi-discover program.

While the hostname advertising is useful in itself, it should get a lot more useful in Dapper, as more programs are built with mDNS support.

This Post Has 5 Comments

  1. lp

    avahi-browse is not able to show you a list of advertised *hosts*. This is a limitation of the mDNS protocol. Only services may be enumerated

  2. Ross

    Assuming you run a SSH daemon, copy ssh.server from /usr/share/doc/avahi-daemon/examples/ to /etc/avahi/services (iirc) and Avahi will advertise your SSH server.

    lp, avahi hacks around that fact by exporting a “workstation” service automatically. 🙂

  3. lp

    It’s not just avahi that does this. Apple does it too.

  4. ed__

    you can also add ‘local’ to the /etc/resolv.conf search line so that non-fqdn’s are automatically queried against .local. saves a few keystrokes if you can stand the security implications.

Comments are closed.