/etc/hosts file in Linux

Back

The /etc/hosts file is a static database of host-names / FQDN and IP addresses. It's suitable for small, relatively static networks. However, it can be a pain for networks where there are frequent changes. 

Every time a system is added or removed, you'll have to change this file not on the local system., but also on every other system on that network.

A simple version of file showing different local systems with their IP addresses : 

192.168.122.50    server1.example.com
192.168.122.150  tester1.example.com
192.168.100.100  outsider1.example.com
127.0.0.1              localhost.localdomain localhost