I’m currently in the process of moving our DNS over to another provider and I was curious as to whether the old or new provider offers faster lookups.
dig shows query times, but I didn’t want to just run that over and over. I decided to write something to do this, in Java since I like Java. I found this post, which has the meat of the work done already. I also read some of Sun’s JNDI/DNS lookup info, which was pretty dense. All I want to do is specify the name server’s IP and do the lookup. I don’t even really care about the result, just how long the query takes.
The thing I wrote only looks up
A records, but can easily be modified to do CNAMEs or whatever. Here’s how you call it:
$ java -jar DNSTester.jar 220.127.116.11 www.google.com 25 Resolved www.google.com to 18.104.22.168 against NS 22.214.171.124 Performed 25 lookups in 233.29 milliseconds. Average 9.3316ms per lookup. $ java -jar DNSTester.jar 126.96.36.199 www.google.com 25 Resolved www.google.com to 188.8.131.52 against NS 184.108.40.206 Performed 25 lookups in 450.034 milliseconds. Average 18.00136ms per lookup.