Brian Long wrote:
If you don't use FQDN in the HOSTNAME variable, then the following
commands will not work as intended:

hostname
hostname -s (supposed to return short hostname)
hostname -f (supposed to return FQDN)

If $HOSTNAME is set to the short hostname, hostname -f will not return
FQDN.
They work for me on RHEL4, RHEL5 and Fedora 8 :-)

hostname -s and hostname -f both resolve whatever gethostname(2) returns using gethostbyname(3). If your /etc/hosts is wrong (that is, the official host name, the fqdn, isn't first) or your DNS doesn't work then you'll be in trouble, but apart from that everything is fine with those commands.

jch

_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to