DNS Lookup for an ip...how?!

Started by
4 comments, last by Impz0r 22 years, 3 months ago
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
Stay Evil & Ugly!
Advertisement
try this!

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
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.
gethostbyaddr()? Just type ''winsock gethostbyaddr'' and you''ll get a mini-tutorial about it.
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.
Thanks alot for your replays :D

Mfg Impz0r
Stay Evil & Ugly!

This topic is closed to new replies.

Advertisement