Archive for June, 2011


Automatically announce hostname on local network using Avahi (Multicast DNS)

I recently setup a server computer in my apartment. I put Ubuntu 11.04 Server Edition on it as the operating system. Since it’s a server, I wanted to be able to connect to it via SSH and not have to actually have to be physically present in front of it to be able to log in to it. That would definitely ease performing administrative maintenance tasks, such as installing software.

The problem was that when I tried to connect to the computer, ssh was unable to make a connection. The command I issued was:

ssh server

where “server” is the hostname of that machine. What puzzled me was that ssh was able to connect to that machine if I issued its IP on the local network instead of its hostname.

After some digging around I found that installing avahi-daemon would solve this problem. I’m not exactly sure what it does, but I understand that it sort of announces the machine’s hostname to the network. So all I did was:

sudo aptitude install avahi-daemon

and after that I could connect to the machine using:

ssh server.local # “.local” must be appended to the hostname for some reason, maybe because of how mDNS works.