CompTIA Linux+ XK0-006 (V8) Practice Question

After adding the line

192.168.50.10 intranet

to /etc/hosts on a CentOS Stream 9 server, an administrator finds that running ping intranet still resolves to 192.168.50.20, the address supplied by the corporate DNS service. The hosts database line in /etc/nsswitch.conf currently reads:

hosts: dns files mdns4

The administrator wants the system to honor the /etc/hosts entry first while still falling back to DNS and Multicast DNS if necessary. Which change will accomplish this goal?

  • Replace "dns" with "bind4" in the hosts line so it reads: hosts: files bind4 mdns4

  • Edit /etc/nsswitch.conf so the line reads: hosts: dns mdns4 files

  • Add the directive "order hosts,bind" to /etc/host.conf and leave nsswitch.conf unchanged

  • Edit /etc/nsswitch.conf so the line reads: hosts: files dns mdns4

CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot