Jump to content
  • Advertisement

Archived

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

P-Dog

gethostbyname strange phenomena

This topic is 5816 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

Granted this is more of a programming question more than a network question, I just thought maybe someone would have a clue. Here''s the situation. In C, normally when one wants to get an IP adddress they would do a gethostbyname call and use the returning structure to access the ip field. However... on some systems one can alter the /etc/hosts file to change the hostname (mild change, let''s say change your server name from xname to xname.server.com). Once this is changed, gethostbyname seems to not work anymore. Can anyone think of anyways to get around this, or an explanation of why? Thanks.

Share this post


Link to post
Share on other sites
Advertisement

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