Re: gethostbyname issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In article <Pine.LNX.4.60.0408171053120.10426@lantana.cs.iitm.ernet.in> you wrote:
> You can use 'uname' sytem call. See man page of uname(2). This should help.

uname does not return the FQDN in all cases. You need to uname and
gethostbyname in combination. I would suggest to copy it from the hostname
utility which is in the net-tools package. This tool is used on all
distributions.

It does not catch all missconfigurations (i.e. localhost as FQDN), but if an
user has this error, it will affect other programs, too.

> hostname -fv
gethostname()=`calista'
Resolving `calista' ...
Result: h_name=`calista.inka.de'
Result: h_aliases=`calista'
Result: h_aliases=`calista.eckenfels.net'
Result: h_aliases=`eckenfels.net'
Result: h_aliases=`web.eckenfels.net'
Result: h_aliases=`secure.eckenfels.net'
Result: h_addr_list=`10.0.0.3'
calista.inka.de

Greetings
Bernd
-- 
eckes privat - http://www.eckes.org/
Project Freefire - http://www.freefire.org/
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux