How to assign hostname to devices in home network

A typical home network consists of a wireless router that networks multiple computers, notebooks, tablets, smartphones, HTPC and other devices. These devices can be accessed by using their IP address. However, it is more convenient to access them using a hostname.

  • Most wireless routers assign dynamic IP address using DHCP. Instead, assigning static IP address to these devices makes it easier to assign a hostname to them later. It is pretty easy to assign static IP address in Ubuntu, Android or Raspbmc. Just make sure that the IP addresses you assign do not clash.

  • On the Ubuntu computer from which you want to access hostnames, add the mapping from the static IP addresses to hostname to the /etc/hosts file. You can give any hostname you want! They take effect immediately after the file is closed.

For example:

# Add to end of /etc/hosts file
192.168.0.100 dad-notebook
192.168.0.101 mom-pc
192.168.0.102 mom-smartphone
192.168.0.103 son-tablet
192.168.0.200 home-htpc

Tried with: Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s