Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Tool Needed for Bulk Nameserver Lookup

Posted on 2011-09-17
4
Medium Priority
?
1,076 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 2000 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:B M
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
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).
Suggested Courses

886 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