exam questions

Exam XK0-004 All Questions

View all questions & answers for the XK0-004 exam

Exam XK0-004 topic 1 question 188 discussion

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

A systems administrator received a request to change the hostname to a new name. Which of the following file configurations should be changed to fix the hostname in the server?

  • A. /etc/sysconfig/network
  • B. /etc/hosts
  • C. /etc/resolv.conf
  • D. /etc/sysconfig/nsswitch.conf
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Reference -
https://www.tecmint.com/set-hostname-permanently-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
Esma
Highly Voted 4 years, 3 months ago
The given answer is correct as the distro being used is Debian/Ubuntu
upvoted 5 times
trusteme
4 years, 3 months ago
In redhat is different and host file are for changing the loop back Address name even in Ubuntu you have to change host name on etc/hostname first
upvoted 3 times
...
Mas511
3 years, 6 months ago
https://linuxhostsupport.com/blog/how-to-change-your-hostname-on-debian/#:~:text=On%20Debian%20based%20systems%2C%20the,d%2Fhostname. hosts is not correct. Hosts is a hostname to IP resolver. In Debian, it is in /etc/hostname
upvoted 1 times
Mas511
3 years, 6 months ago
*unless setting the loopback
upvoted 1 times
...
...
...
pinonino
Most Recent 2 years, 10 months ago
in ubutu this is the steps to change the hostname: Edit /etc/hostname, remove old hostname and make an entry of new hostname Edit /etc/hosts, replace old hostname with new hostname Reboot the system. The answers are limited to /network and /hosts due to the fact that to modify the hostname on Ubuntu requires to modifidy both the /etc/hosts and the /etc/hostname files i think the correct answer is the A. Because it is the fastest way to change the hostname to a new name on the Server. So the A is the correct answer for me.
upvoted 1 times
...
augustogcn
3 years, 1 month ago
In "/etc/sysconfig/network" You set the hostname: HOSTNAME="myserver.local" In "/etc/hosts" You bind an IP to resolve the name: XXX.XXX.XXX.XXX myserver.com
upvoted 2 times
...
trusteme
4 years, 3 months ago
Should be A
upvoted 1 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