I'm sure this is a FAQ, but I sure can't find the answer. I've tried the usually suggested gethostname()/gethostbyname() approach, but that only returns the *first* match in /etc/hosts. In one case that was 127.0.0.1. Clearly this was a case where /etc/host.conf gave priority to the host file.
I don't want to call gethostent() because (if I understand the man page correctly) that would limit me entries /etc/hosts ignoring DNS. I guess I could do a gethostname()/gethostbyname() and then if I fail to find a usable (non-rfc1918) address gethosten(). Is there a better way? Also is listing 127.0.0.1 as the actual host name in addition to "localhost" in /etc/hosts considered to be proper ? _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message