Which file is used for Hostname and IP Address mapping in a network?
-
/etc/hosts
-
/etc/hosts.allow
-
/etc/hosts.deny
-
/etc/hosts.test
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.