A Linux server is having intermittent problems resolving domain names, which is affecting the ability to access external websites. None of the remote services has reported downtime, and other devices on the same network are not experiencing any issues. What is the BEST step to take to diagnose the issue on the Linux server?
Immediately modify the /etc/resolv.conf file to use different nameservers without doing further investigation.
Run dig +trace example.com or nslookup example.com to trace the path of the query from the root name servers downward.
Ping the domain name in question to verify if domain name resolution works intermittently.
Check for a high number of outgoing DNS queries that might indicate a misconfigured service or DNS flood attack.
To diagnose domain name resolution issues, running dig +trace example.com or nslookup example.com can provide detailed information about the entire process of resolving a domain name, from the root servers down to the authoritative name servers. Comparing this output with known good output can reveal any discrepancies or failures in the resolution process. If dig +trace or nslookup provides the correct information, this indicates that the issue is intermittent or specific to the server's resolver configuration rather than a problem with the DNS server itself. Modifying /etc/resolv.conf would not fully diagnose the problem, as it could be a configuration issue, and checking for a high number of outgoing DNS queries or pinging the domain would not yield detailed resolution process information. Therefore, using dig (with the +trace option) or nslookup is the best initial step for diagnosis.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the 'dig' command do?
Open an interactive chat with Bash
What is the purpose of the '/etc/resolv.conf' file?