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:
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. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost # 18.104.22.168 test.mozilla.info 192.168.1.15 test.webadmin.info 127.0.0.1 test.dturunners.dk 127.0.0.1 test.dtu.info [03:15:49@bjarne]$