Link to home
Start Free TrialLog in
Avatar of David Sankovsky
David SankovskyFlag for Israel

asked on

bash script to resolve all hostnames in a list

Hi Guys,
I have a list of over 100 domains.
I need to get the A record of each one of them through a bash script.
I also need the same bash script to write the resolve next to FQDN itself...
Meaning, before the script:
cat /home/user/domains.list

Open in new window

will return
google.com
amazon.com

and after the script it will return
google.com 216.52.217.78
amazon.com 54.239.25.200
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

I'm curious what you are going to do with them.  I ask because your two examples, google.com and amazon.com have not just one but many IP addresses.
Avatar of David Sankovsky

ASKER

You are correct Dave but they are only examples. in my scenario I know for a fact that no one will have more than one resolve, I do however expect some to return nxdomain.

The point is simple I have a plesk server we wish to close that has over 100 FQDNs. We want to close this server, we just need to know which domains still actually point to this server.
Interesting.  I would have thought that the Plesk software would tell you that.  Or do you know that some have moved to other servers already?
I just wrote a PHP script that does the lookup for my own websites.  I can post that if you want.
Might even be better I could integrate that into one of my management sites...
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok, now I just need to make that read from a file.
Thanks a lot :)
You're welcome, glad to help.