Traceroute is a convenient network diagnostic tool for tracking the pathway taken by a packet on an IP network from source to destination. It also records the transit delays of packets across the network. However, did you know that this tool can sometimes be slowed down due to DNS resolutions? Luckily, there’s an easy fix for this.
Understanding the Default Behavior
By default, Cisco IOS and IOS-XE attempt to resolve the IP addresses of each hop in a traceroute to a Fully Qualified Domain Name (FQDN) using Reverse DNS (rDNS). While this is certainly helpful when you need to identify the devices in the network path, it can slow down the process if the DNS resolution takes a long time or fails.
Let’s take a look at an example:
Router# traceroute 8.8.8.8 Type escape sequence to abort. Tracing the route to google-public-dns-a.google.com (8.8.8.8) 1 192.168.0.1 1 ms 1 ms 1 ms 2 gateway.example.com (10.1.1.1) 10 ms 10 ms 10 ms 3 another-gateway.example.com (10.2.2.2) 20 ms 20 ms 20 ms 4 google-public-dns-a.google.com (8.8.8.8) 30 ms 30 ms 30 ms
As you can see, it tries to resolve each hop to a domain name. If these DNS resolutions are slow or fail, it can slow down the traceroute.
Speeding Up Traceroute
This is where the numeric
keyword comes in handy. Using this keyword with your traceroute command forces the output to display IP addresses only, avoiding the DNS resolution process. This can make the traceroute complete significantly faster.
Here’s an example of how you would use the “numeric” keyword:
Router# traceroute 8.8.8.8 numeric Type escape sequence to abort. Tracing the route to 8.8.8.8 1 192.168.0.1 1 ms 1 ms 1 ms 2 10.1.1.1 10 ms 10 ms 10 ms 3 10.2.2.2 20 ms 20 ms 20 ms 4 8.8.8.8 30 ms 30 ms 30 ms
With this command, the router will not attempt to resolve the IP addresses to FQDNs. The output is much more concise, and the traceroute command will typically run faster because it’s not spending time trying to resolve IP addresses to FQDNs.
Conclusion
Knowing the ins and outs of the tools you’re using can significantly improve your productivity and your work speed. One example is the “numeric” keyword with the traceroute command on Cisco IOS and IOS-XE devices. So, remember this little trick next time you’re waiting for a traceroute to complete!