Samuel Williams Friday, 04 September 2009

I was testing RubyDNS and found that it was a bit unreliable after a few minutes. This was actually due to a bug in the net-mdns resolver. Basically, if you want DNS resolving to work, don't use net-mdns gem. The standard resolver, works fine though (apparently it used to be broken, which is why I used the net-mdns implementation in the first place).

Anyway, during testing I made a script for testing DNS resolution, and it is bundled as part of RubyDNS:

$ rd-resolve-test
Starting test with 14 domains...
Using nameservers:
Only long running queries will be printed...
Starting threads...
		0.54s: =>
		0.60s: =>
		0.65s: =>
		0.64s: =>
		0.52s: =>
		0.83s: =>
		0.86s: =>
		0.89s: =>
		0.82s: =>
		0.55s: =>
		0.50s: =>
		0.59s: =>
		0.57s: =>
		0.52s: =>
Requests: 200 Average time: 0.32242531

rd-resolve-test is a simple executable which starts a number of threads. Each thread resolves a number of names against given DNS servers. This allows you to test both performance and success of a DNS server under load.

You can specify a file that contains a list of domains to use for testing, e.g.:

# domains.txt

$ rd-resolve-test -d domains.txt
Starting test with 2 domains...

# ... and so on

You can customize the number of threads and names resolved per thread. Use -h super powers for more information!


Leave a comment

Please note, comments must be formatted using Markdown. Links can be enclosed in angle brackets, e.g. <>.