Multiple choice technology operating systems

Which file is used for Hostname and IP Address mapping in a network?

  1. /etc/hosts

  2. /etc/hosts.allow

  3. /etc/hosts.deny

  4. /etc/hosts.test

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The /etc/hosts file is used for hostname to IP address mapping. It contains lines in the format 'IP_address hostname aliases' and is consulted before DNS queries. The /etc/hosts.allow and /etc/hosts.deny files are used by TCP wrappers for access control (which hosts can connect to which services), not for name resolution. /etc/hosts.test is not a standard Unix file.