Archived

This topic is now archived and is closed to further replies.

Impz0r

DNS Lookup for an ip...how?!

Recommended Posts

Impz0r    166
hi, I''m searching for a method to make an DNS lookup for a given IP Address. If you know mirc, then you know the function /DNS that would give you the ip and the DNS name like pDF7423DS.dip.t-dialin.net. Did somebody knows how does it work? Some code snippets for sockets would be fine.. :D Thanks alot... Mfg Impz0r

Share this post


Link to post
Share on other sites
Rube    122
lol

do a search for "gethostbyaddr". If you''re on a *nix box, just do a manpage on it. If you''re on Windows get the Win32 API from MS or just go to their online library (www.msdn.microsoft.com).

Essentially you pass it an addr structure and it will return a hostent structure. You can easily find some tuts on how to extract the DNS name from the hostent structure.

R.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
gethostbyaddr()? Just type ''winsock gethostbyaddr'' and you''ll get a mini-tutorial about it.

Share this post


Link to post
Share on other sites
JonStelly    127
Actually, if the /DNS function works as you claim, supply an IP and return the DNS name, then it is using a reverse dns lookup. It will help you to dig thru the DNS RFC.

Share this post


Link to post
Share on other sites