zeroconf networking in Debian

I know essentially nothing about zeroconf networking, but I thought I'd try to get it working on my laptop, so I'll be ready to use it at the next DebConf, ad-hoc wireless network, DNS-less office , or similar situation, where I want to access a friend's computer without reciting IP addresses, or perhaps just farm out C compiles to whatever unknown machines are nearby.

The first thing I tried was the zeroconf package. This makes interfaces get assigned an ip address in the link-local 169.254.137 range, generally in addition to whatever IP address dhcp supplies. Annoyingly this hides the "real" ip address in the output of route, althogh ip addr list will show both.

Since you really only need this as a fallback for as-hoc networks that lack a DHCP server, I edited /etc/default/zeroconf and enabled the option that makes it only assign an address as a fallback if dhcp does not provide one. I don't really understand why this is not the default.

Next I installed libnss-mdns. This allows looking up hostnames in the .local domain, which will be resolved via multicast dns over the zeroconf network of local machines. To make it work /etc/nsswitch.conf needs to be edited to have this line:

hosts:          files dns mdns

I filed bugs on the [lack of documentation about that, and also on base-files to possibly get it supported by default w/o manual editing, which we'll need if we want regular users to use this.

Finally, if you want your machine to have a .local hostname in mDNS, you need a responder to broadcast it. One such is in the mdnsresponder, which unfortuatly has an unresolved license mess that has been pending resolution for too long. It also seems to be the only package in Debian to perform this task, so I used it anyway. :-( It's rather lacking in documentation and it took me a while to work out that I didn't really need to edit its config file, since it defaults to broadcasting your hostname.

Now I could ping dragon.local; if I had two hosts they should automatically network together with no configuration.

Of course to make this really useful you need a way to discover services on the network, and mdns-scan is one way to do this easily. The howl-utils can be used to look for specific services and to publish a service. But they have no useful docs in Debian, not even man pages, so see this page for some usage hints.

Of the other zeroconf stuff in Debian, daapd looked useless unless you have iTunes, and I couldn't find anything else, aside from probably gnome and kde GUI stuff.

Finally, I've been thinking about whether it would make any sense to install any of this stuff by default in Debian as part of the laptop task or some other task. Installing libnss-mdns seems like a reasonable thing to do, once it works with no configuration. mdnsresponder would also be fine to install, if it remains in Debian. zeroconf might be ok to include as well, unless its behavior of hiding real IP addresses is too annoying.

To be useful as a server on a zeroconf network, Debian should publish running services, possibly integrated with init scripts somehow, but I don't know what would be a good way to do that.