How to get all IP Addresses for a host from DNS server?

Status
Not open for further replies.

atulnandan

New member
Joined
May 24, 2011
Messages
1
I have a program for which the purpose is to find all IP addresses associated with a host in a particular domain. For example, let's say that i want to find all IP addresses associated with "rediff.com". If i do "nslookup" on rediff.com, i get different set of IP addresses at different point of time as follows:


atul> nslookup rediff.com
Server: ns.otherdnserver.org
Address: 10.12.35.8

Non-authoritative answer:
Name: rediff.com
Address: 64.212.198.153
Name: rediff.com
Address: 64.212.198.144



atul> nslookup rediff.com
Server: ns.otherdnserver.org
Address: 10.12.35.8

Non-authoritative answer:
Name: rediff.com
Address: 168.143.241.10
Name: rediff.com
Address: 168.143.241.90


Same behaviour is observed with gethostbyname() api utility which my program is calling and i am getting different subset of IP addresses at different point of time.

Is there a way where i can invoke gethostbyname() with a hostname with certain specific option and it returns me all IP addresses associated with it in one invocation, not in multiple invocations as mentioned in the above example?
 
well nslookup is windows command like dig for linux.

I suppose you are on the wrong forum man.

This is just for Directadmin related issue.

Regards
 
The nslookup command works on linux as well.

That said, I agree that this isn't the right forum for debugging scripts which have nothing to do with DirectAdmin.

That all said, the short answer is:

No; you can't find ip#s which the nameservers aren't telling you.

Jeff
 
Status
Not open for further replies.
Back
Top