exam questions

Exam XK0-004 All Questions

View all questions & answers for the XK0-004 exam

Exam XK0-004 topic 1 question 207 discussion

Actual exam question from CompTIA's XK0-004
Question #: 207
Topic #: 1
[All XK0-004 Questions]

An administrator needs to change the DNS domain search order of a single Linux host to localize it better. Which of the following files should the administrator edit?

  • A. /etc/resolv.conf
  • B. /etc/hosts
  • C. /etc/nsswitch.conf
  • D. /etc/dhcpd.conf
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
Reference:
https://www.cyberciti.biz/faq/howto-change-dns-search-order-in-linux/

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Dan_Dan_The_Data_Center_Man
Highly Voted 3 years, 6 months ago
Correct Answer C. /etc/nsswitch.conf Linux Changing DNS Search Order Under Linux you need to use /etc/nsswitch.conf file which is used by system databases and Name Service Switch configuration file. Open /etc/nsswitch.conf file using text editor: # vi /etc/nsswitch.conf Look for hosts: hosts: files dns mdns4 Set above order as per your requirement. Close and save the file.
upvoted 8 times
Didi31
3 years, 3 months ago
Hi Dan, Did you take the Linux+ exam yet? Are these questions a good representation of the test?
upvoted 1 times
...
...
DiaaEmara
Most Recent 2 years, 5 months ago
we can configure /etc/nsswitch.conf to define if we are going to use a static file like /etc/hosts to resolve names first, a DNS resolver as a second choice and even maybe a NIS server as a third.
upvoted 1 times
...
virtualko
2 years, 8 months ago
Personally, the way I've always done it (RHEL, OEL, CentOS) is IF I wanted to change the domain search order, that's /etc/resolv.conf IF I wanted to make sure it reads the /etc/hosts file FIRST before DNS, then that's /etc/nsswitch.conf Just my $.02
upvoted 1 times
...
o0o0
3 years, 12 months ago
The /etc/nsswitch.conf file defines the order in which the system searches for a hostname, not the list of DNS servers used. So C is correct
upvoted 4 times
...
rjrpaz
4 years ago
The referenced url doesn't show how to change the DNS domain search order. It shows how to configure the different resources we have in a Linux server to resolve name. Yes, we can configure /etc/nsswitch.conf to define if we are going to use a static file like /etc/hosts to resolve names first, a DNS resolver as a second choice and even maybe a NIS server as a third. But that is not a proper answer for the question. Rigth answer is "A". You can change the domain search order for DNS, just reordering the "domain" entries in /etc/resolv.conf.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago