Archived

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

Impz0r

DNS Lookup for an ip...how?!

Recommended Posts

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
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