Advertisement

gethostbyname strange phenomena

Started by July 17, 2002 02:34 PM
0 comments, last by P-Dog 22 years, 6 months ago
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.
What do you mean by, "it doesn''t seem to work anymore?" Do you get an error (function fails) or do you get strange data back?



Dire Wolf
www.digitalfiends.com
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com

This topic is closed to new replies.

Advertisement