Skip to content

Instantly share code, notes, and snippets.

@ekkis
Created June 16, 2015 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekkis/cb956423c8d89549b6ad to your computer and use it in GitHub Desktop.
Save ekkis/cb956423c8d89549b6ad to your computer and use it in GitHub Desktop.
Checks a list of domains or e-mail addresses
#!/usr/bin/perl
use Socket;
$\ = $/;
$debug = 1;
@d = @ARGV;
unless (@d) {
print "Enter a list of domains or e-mail addresses to be checked, one per line:";
chomp(@d = <>);
}
for (@d) {
s/.*@// if /\@/;
$ret = gethostbyname($_);
print "$_: " . inet_ntoa($ret) if $debug && $ret;
exit 1 unless defined $ret;
}
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment