I am trying to create a list of all possible IP addresses for a given domain name. I think I'm close, but I don't know what I am missing (or if there is a better way).
First I create a list of domain options, for example:
webkinz.com www.webkinz.com
Then I loop around this list and run dig for each change as follows:
while read domain; do IPs=`dig $domain | grep $domain | grep -v ';' | awk '{ print $5 }'`; echo " ${IPs}" >> /tmp/IPs;
My IP address is as follows:
66.48.69.100 www.webkinz.com.edgesuite.net.a1339.g.akamai.net.
Only 3 problems .: - (
- Pass returned domains when I was expecting only ip addresses.
- Some, like my script removed spaces between domains.
- Some of the ip addresses from
dig www.webkinz.com missing.
So how do I do this? How can I find out if dig returned a different domain instead of an IP address and ran it in this domain? Am I just ignoring the domain names returned from dig and is the number enough for the IP addresses? I want to catch every IP address that will be resolved in the domain, if possible. I did not think it should be so difficult. Any ideas?
exvance
source share