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 22.214.171.124 www.google.com 25 Resolved www.google.com to 126.96.36.199 against NS 188.8.131.52 Performed 25 lookups in 233.29 milliseconds. Average 9.3316ms per lookup. $ java -jar DNSTester.jar 184.108.40.206 www.google.com 25 Resolved www.google.com to 220.127.116.11 against NS 18.104.22.168 Performed 25 lookups in 450.034 milliseconds. Average 18.00136ms per lookup.