Networking – How to Access Machines on the Home Network with Their Machine Name

avahinetworking

I have all machines connecting to the internet through a wireless router (occasionally I plug a machine into the router via cable). I have installed the ssh package and can access one Ubuntu machine from another using, for example, "ssh 10.0.0.2". However, the local IP addresses change as machines are switched off and on and reconnect to the router, so I'd prefer to use "ssh machinename".

If I do type "ssh machinename", nothing happens, no error, no returning to the prompt.

What do I need to install/configure to access Ubuntu machines via their machine name?

(As a side note, I have Samba installed so I can access Windows machines on the same network. I have set name resolve order = lmhosts wins bcast host because I use OpenDNS, I'm not sure if this could affect Ubuntu networking. Name-based resolution works in both directions between Windows and Ubuntu (for example, connecting to an Ubuntu machine with WinSCP).)

Best Answer

First, make sure you have the Avahi daemon installed. (Should be installed by default on Ubuntu Desktop, but not on Server.)

sudo apt-get install avahi-daemon

Then to access them, add ".local" to the end of the name, for example

ssh machinename.local

I'm not sure if it's possible to remove the need to add .local

Related Question