XK0-004 · Question #7
A junior Linux administrator is updating local name resolution to support IPv6. The administrator issues the command cat /etc/hosts and receives the following output: 127.0.0.1 localhost Which of…
The correct answer is B. Modify the /etc/hosts file, and add the ::1 localhost entry to the file. This question tests knowledge of the IPv6 loopback address format used in /etc/hosts for local name resolution.
Question
A junior Linux administrator is updating local name resolution to support IPv6. The administrator issues the command cat /etc/hosts and receives the following output:
127.0.0.1 localhost Which of the following actions should the administrator perform to accomplish this task?
Options
- AModify the /etc/hosts file, and add the ipv6 localhost entry to the file.
- BModify the /etc/hosts file, and add the ::1 localhost entry to the file.
- CModify the /etc/hosts file, and add the ipv4 localhost entry to the file.
- DModify the /etc/hosts file, and add the 0.0.0.0 localhost entry to the file.
How the community answered
(35 responses)- B91% (32)
- C3% (1)
- D6% (2)
Why each option
This question tests knowledge of the IPv6 loopback address format used in /etc/hosts for local name resolution.
'ipv6' is not a valid IP address - it is a keyword and cannot be used as an address entry in /etc/hosts.
The IPv6 loopback address is ::1, which is the compressed notation for 0000:0000:0000:0000:0000:0000:0000:0001. Adding the line '::1 localhost' to /etc/hosts maps the hostname 'localhost' to the IPv6 loopback interface, enabling IPv6 local name resolution.
Adding an IPv4 entry such as 127.0.0.1 does not accomplish IPv6 support and is already present in the file.
0.0.0.0 is an IPv4 unspecified address used for binding, not the loopback address, and does not represent localhost in any standard configuration.
Concept tested: IPv6 loopback address in /etc/hosts
Source: https://man7.org/linux/man-pages/man5/hosts.5.html
Topics
Community Discussion
No community discussion yet for this question.