Cisco CCNA (200-301)IP ServicesEasy
A network engineer is troubleshooting a connectivity issue to a remote server. They suspect that the router's DNS resolution might be failing. To verify the router's ability to resolve a specific hostname, 'example.com', to its IP address, which command would be most appropriate?
- Ashow ip dns cache
- Bping example.com
- Ctraceroute example.com
- Dshow host example.com
Show answer & explanationAnswer & explanation
Correct answer: B. ping example.com
The 'ping' command in Cisco IOS will attempt to resolve the hostname to an IP address before sending ICMP echo requests. If the DNS resolution fails, the ping will fail and indicate a hostname resolution issue, making it a quick and effective way to test DNS functionality from the router.
Why the other options are wrong
- A. This command shows entries in the router's DNS cache, but it doesn't actively test a new resolution or indicate if the router can resolve 'example.com' if it's not already cached.
- C. The 'traceroute' command also performs a DNS lookup, but its primary purpose is to trace the path, and it might provide more verbose output than needed for a simple DNS resolution test.
- D. There is no standard 'show host' command in Cisco IOS for this purpose. 'show hosts' displays static host entries, not dynamic DNS lookups.
Cisco IOS DNS Resolution Test
Using various Cisco IOS commands to verify if a router can successfully resolve a hostname to an IP address via DNS.
- Ping command implicitly tests DNS resolution.
- Router must have 'ip domain lookup' and 'ip name-server' configured.
- Can also use 'nslookup' if available (though 'ping' is often sufficient).
Memory trick: To see if the router 'knows' a name, just 'ping' it – if it can't find it, it'll tell you!