December 2009 Archives

Comparing DNS Servers in Perl

| No Comments
I've been reading about Google's new DNS service with great interest.  I had to switch to OpenDNS some time ago when my ISP began redirecting 404's to a search page.  This wreaked havoc on my link verification tools.

While reading, I came upon a shell script at that I wanted to try.  Since I run WinXP, I translated it to Perl and spruced it up a bit.  I installed the utility from and away we went...

# - test dns server times

use strict;
use warnings;

my @urls = qw(

my %dns_servers = (
	Level_3	=> '',
	Google	=> '',
	OpenDNS	=> '',

for my $dns_firm (sort keys %dns_servers) {
	my $dns_ip = $dns_servers{$dns_firm};
	for my $url (@urls) {
		my $result = `dig \@$dns_ip $url`;
		my ($time) = $result =~ /Query time: (\d+)/s;
		print "$dns_firm\t$url\t$time\n";

About this Archive

This page is an archive of entries from December 2009 listed from newest to oldest.

August 2009 is the previous archive.

April 2011 is the next archive.

Find recent content on the main index or look in the archives to find all content.


OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.38