XK0-005 · 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. To update local name resolution for IPv6, the IPv6 loopback address ::1 needs to be added to the /etc/hosts file.
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
(22 responses)- A5% (1)
- B91% (20)
- C5% (1)
Why each option
To update local name resolution for IPv6, the IPv6 loopback address `::1` needs to be added to the `/etc/hosts` file.
While the general goal is correct, 'ipv6 localhost entry' is too vague and does not specify the correct `::1` IPv6 loopback address.
The IPv6 loopback address is `::1`. Adding the entry `::1 localhost` to the `/etc/hosts` file enables the system to correctly resolve 'localhost' to its IPv6 loopback address, supporting IPv6-aware applications.
Adding an IPv4 localhost entry is irrelevant to updating local name resolution specifically for IPv6, as an IPv4 entry (`127.0.0.1 localhost`) already exists.
`0.0.0.0` is a placeholder or unassigned address, not the IPv4 loopback address, and is unrelated to configuring IPv6 localhost resolution.
Concept tested: Linux IPv6 local name resolution
Source: https://en.wikipedia.org/wiki/Localhost#IPv6_loopback
Topics
Community Discussion
No community discussion yet for this question.