Jump to content
  • Advertisement

Archived

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

DNS Lookup for an ip...how?!

This topic is 5968 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
gethostbyaddr()? Just type ''winsock gethostbyaddr'' and you''ll get a mini-tutorial about it.

Share this post


Link to post
Share on other sites
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!