nerdexam
CompTIA

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.

System Management

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)
  • A
    5% (1)
  • B
    91% (20)
  • C
    5% (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.

AModify the /etc/hosts file, and add the ipv6 localhost entry to the file.

While the general goal is correct, 'ipv6 localhost entry' is too vague and does not specify the correct `::1` IPv6 loopback address.

BModify the /etc/hosts file, and add the ::1 localhost entry to the file.Correct

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.

CModify the /etc/hosts file, and add the ipv4 localhost entry to the file.

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.

DModify the /etc/hosts file, and add the 0.0.0.0 localhost entry to the file.

`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

#Linux network configuration#IPv6#Local name resolution#/etc/hosts

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice