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";

Leave a comment

About this Entry

This page contains a single entry by Bill Ruppert published on December 4, 2009 9:10 AM.

Removing HTML::FormFu elements from a form was the previous entry in this blog.

Cache::FileCache Example is the next entry in this blog.

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