A `hosts` file is used to map hostnames to IP addresses on a TCP/IP-enabled computer.

A hosts file is used to map hostnames to IP addresses on a TCP/IP-enabled computer. On Unix and Unix-like operating systems ( Linux, OSX, FreeBSD, NetBSD, et al), the file is located at /etc/hosts. In Microsoft Windows, the file may be located in different places depending on the version of the operating system. In Plan 9 from Bell Labs it is located at /lib/ndb/hosts

On most systems, the behaviour of /etc/hosts depends on configuration within the /etc/nsswitch.conf file.