Jump to content
  • Advertisement


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


gethostbyname strange phenomena

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

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!