EX200 Exam QuestionsBrowse all questions from this exam

EX200 Exam - Question 69


SIMULATION -

Successfully resolve to server1.example.com where your DNS server is 172.24.254.254.

Show Answer
Correct Answer:

To successfully resolve server1.example.com using the DNS server at 172.24.254.254, you should configure the DNS server in the /etc/resolv.conf file. Open /etc/resolv.conf with a text editor and add the line 'nameserver 172.24.254.254'. Save the file, then use the 'host server1.example.com' command to verify that server1.example.com is being resolved correctly. This method sets the DNS server for the session, and the 'host' command will query the specified DNS server for the IP address of server1.example.com.

Discussion

4 comments
Sign in to comment
sugisho
Jul 17, 2021

example nmcli c m ens192 1pv4.dns 172.24.254.254 or nmtui

wizojlo
Feb 28, 2024

absolutey the easiest and also persistent way to do it. just a sidenote, there is a typo (1pv4.dns --> should be ipv4.dns)

mattd81
May 14, 2022

Can you add this to the vim /etc/hosts file to complete this request?

wizojlo
Feb 28, 2024

I do not see it like this. /etc/hosts contains domain name and IP address of each custom machine/server we want to add. The question does not provide IP address of the server, only DNS server. The IP of the server itself is unknown and DNS should resolve it. Correct method (and easiest, IMHO) would be to use nmcli like sugisho suggested. Modifying resolv.conf, on the other hand, would only result in temporary solution as this file gets overwritten automatically on each reboot by NetworkManager, unless we add a custom configuration to /etc/NetworkManager/conf.d/something.conf with contents: [main] dns=none Only then can we modify the /etc/resolv.conf manually and it will persist.

Acesyo
Mar 10, 2023

echo "172.24.254.254 server1.example.com" >> /etc/hosts

PENNSHARK
Jan 10, 2024

echo "172.24.254.254 server1.example.com" >> /etc/hosts