Created
October 1, 2014 19:07
-
-
Save chrisice/ff2dddba5d4a4c912025 to your computer and use it in GitHub Desktop.
Check if a domain resolves
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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