PrepAway - Latest Free Exam Questions & Answers

Which of the following looks like a correct entry in the /etc/hosts file:

Which of the following looks like a correct entry in the /etc/hosts file:

A.
localhost 127.0.0.1 localhost.localdomain

B.
localhost.localdomain localhost 127.0.0.1

C.
localhost localhost.localdomain 127.0.0.1

D.
127.0.0.1 localhost.localdomain localhost

E.
localhost.localdomain 127.0.0.1 localhost

Explanation/Reference:
From the man pages:
/etc/hosts is a simple text file that associates IP addresses with hostnames, one line per IP address. For each host a single line should be present with the following information:
              IP_address canonical_hostname [aliases…]

Example:
127.0.0.1    localhost
:1           localhost ip6-localhost ip6-loopback


Leave a Reply