atulnandan
Programmer
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?
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?