|
<- Previous Message | Next Message -> Thread Index [isp-dns] Re: script to list nameservers
Andrew, Andrew P. Kaplan wrote: Maybe the script below will help you. It expects a file name as the command line arg. The file should contain the list of your domains, one per line. Uses Net::DNS perl module.Does anyone have a script that I can run against my 1000 domains on my master server that would list domain name and authorative name servers. My slave servers is going off line soon and I have been moving the nameserver, but use a range of registrars with some being out of my control so I need a list of domains that still have the old nameservers. #!/usr/bin/perl # # Perl script which expects a file containing a list of domains and # prints their name servers. use Net::DNS; if (@ARGV != 1) { print "Script to check the name servers used by the domain\n\n"; print "Usage: $0 filename\n\n"; print "Where, filename is the file containing list of domains\n"; exit; } open (DOM, "$ARGV[0]") || die "$!"; while (<DOM>) { chomp($domain = $_); my $res = Net::DNS::Resolver->new; my $query = $res->query("$domain", "NS"); if ($query) { print "Name Servers for $domain are:\n"; foreach $rr (grep { $_->type eq 'NS' } $query->answer) { #print "$domain\n"; print $rr->nsdname, "\n"; } } else { warn "query failed: ", $res->errorstring, "\n"; } print "\n"; } -- Regards, Gaurav Sabharwal http://www.inwire.net To unsubscribe via postal mail, please contact us at: Jupitermedia Corp. Attn: Discussion List Management 475 Park Avenue South New York, NY 10016 Please include the email address which you have been contacted with.
Thread Index |