Skip to content

Instantly share code, notes, and snippets.

@chrisice
Created October 1, 2014 19:07
Show Gist options
  • Save chrisice/ff2dddba5d4a4c912025 to your computer and use it in GitHub Desktop.
Save chrisice/ff2dddba5d4a4c912025 to your computer and use it in GitHub Desktop.
Check if a domain resolves
#!/usr/bin/perl
use Net::DNS::Check;
sub check_domain_resolution {
my $domain = $ARGV[0];
if (!defined $domain) {
print "Please define a domain. Usage: check-domain-resolution.pl domain \n";
}
else {
my $dnscheck = new Net::DNS::Check(
domain => "$domain"
);
print ($dnscheck->check()?"Resolves\n":"Does not resolve\n");
}
}
check_domain_resolution();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment