LX0-104 · Question #261
Which of the following looks like a correct entry in the /etc/hosts file?
The correct answer is D. 127.0.0.1 localhost.localdomain localhost. Entries in the /etc/hosts file typically follow the format of IP address, followed by the fully qualified domain name (FQDN), and then any aliases for that IP.
Question
Options
- Alocalhost 127.0.0.1 localhost.localdomain
- Blocalhost.localdomain localhost 127.0.0.1
- Clocalhost localhost.localdomain 127.0.0.1
- D127.0.0.1 localhost.localdomain localhost
- Elocalhost.localdomain 127.0.0.1 localhost
How the community answered
(20 responses)- C10% (2)
- D85% (17)
- E5% (1)
Why each option
Entries in the `/etc/hosts` file typically follow the format of IP address, followed by the fully qualified domain name (FQDN), and then any aliases for that IP.
The IP address `127.0.0.1` should precede the hostnames and aliases.
The IP address `127.0.0.1` should precede the hostnames and aliases.
The IP address `127.0.0.1` should precede the hostnames and aliases.
The standard format for entries in `/etc/hosts` is `IP-address FQDN alias1 alias2 ...`, meaning the IP address comes first, followed by the canonical hostname, and then any optional aliases.
The IP address `127.0.0.1` should precede the hostnames and aliases.
Concept tested: /etc/hosts file format
Source: https://www.man7.org/linux/man-pages/man5/hosts.5.html
Topics
Community Discussion
No community discussion yet for this question.