Internet Technologies
and Their Applications


As you we told during the lecture, the original use for the file /etc/hosts was to have a complete record of every computer connected to the Internet. With the advent of the DNS servers, this use of /etc/hosts was abandoned.

The present day use of /etc/hosts is for special cases.
The most common uses are the following:

  • redirecting URLs to localhost for testing purposes
  • redirecting URLs to other computers on a LAN or WAN

Take for instance a look at my /etc/hosts:

[03:15:46@bjarne]$ cat /etc/hosts
# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##       localhost broadcasthost
::1             localhost 
#     test.mozilla.info    test.webadmin.info       test.dturunners.dk       test.dtu.info