Connecting via hostnames

One of the problems with IP addresses is they are hard to reconcile to the machine they relate to. Its always much easier to talk about pimaster or pislave1 than 192.168.1.200 or 192.168.1.201. If you have a crappy DHCP server like I have with the BT Home Hub, then the easier way around this is to modify the hosts file on each of the machines, which is used by the OS to lookup the mapping between hostname and ip before it goes off to name servers.

sudo vi /etc/hosts

and you’ll see something like this

Add lines ( highlighted in blue ) for each device in your network

I’ve replaced the name for 127.0.0.1 with pislave1, the name of the device I am logged into, and then added the ip addresses for pimaster, pislave1-4 and readynas

Repeat this for each machine, machine sure you change the name for the device 127.0.0.1 to the actual name of the device you are logged into

Your email address will not be published. Required fields are marked *