Solved

Tool Needed for Bulk Nameserver Lookup

Posted on 2011-09-17
4
973 Views
Last Modified: 2016-06-08
I am getting ready to relocate data centers, and am trying to compile a list of DNS changes that will be needed.  I have a spreadsheet of hundreds of domain names that are owned by my company, and hosted at the old data center.  I'm looking for a tool that would allow me to lookup the nameservers and IP for each of the domains, and generate a list.  I've looked at Sam Spade - but it looks like it needs custom scripts for bulk lookup, and the site with the documentation seems to be down.  What I need to end up with is a text file or spreadsheet showing, domain, nameservers, and IP if possible.

Any suggestions would be greatly appreciated.

Thanks
Dwight
0
Comment
Question by:DwightIVD
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
acbxyz earned 500 total points
ID: 36554486
If you have a linux server, you can use this little bash-script
#!/bin/sh

export LC_MESSAGES=C

echo '"hostname";"ip address";"nameservers"' > lookup-result.csv
while read HOST; do
    IP=$(host -t a  $HOST | awk '{print $4}' | tr '\n' ' ')
    NS=$(host -t ns $HOST | awk '{print $4}' | tr '\n' ' ')
    echo "\"$HOST\";\"$IP\";\"$NS\"" >> lookup-result.csv
done < lookup-domains.txt

Open in new window

The scripts needs a file lookup-domains.txt in your working directory containing one domain name per line and will give you a csv-file with three columns
0
 

Author Comment

by:DwightIVD
ID: 36554819
That looks like just what I need.  I'll try it tonight.  Thanks!
0
 

Author Closing Comment

by:DwightIVD
ID: 36556800
Worked perfectly.  Thanks!
0
 

Expert Comment

by:Bhavik Hingrajia
ID: 41645220
I tried it and it game me no records... it just shows found, found, found in other 3 columns... no records... PFA
lookup-result.csv
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question