On Thu, 4 Oct 2001, Thomas M. Albright wrote:
> For the hell of it it tried those commands on my web server. It works
> fine, but they're not consistent. How can I and/or should I fix that?
Sorry, you mis-understood. I probably should have been more verbose, so
it is not your fault. Let me explain:
hostname # kernel's idea of the hostname
hostname -s # short name (in case system name is FQDN)
hostname -f # FQDN (Fully Qualified Domain Name)
hostname -a # any aliases the host knows about
hostname -i # IP address the host knows about
host `hostname` # queries DNS to lookup your hostname
host `hostname -i` # queries DNS to lookup your IP address
All should yield consistent answers, in that the DNS should match any
/etc/hosts files, IP address and domain names map back and forth to each
other, and the FQDN is correct. For example, on my workstation:
$ hostname
dragon
$ hostname -s
dragon
$ hostname -f
dragon.inside.ntisys.com
$ hostname -a
dragon
$ hostname -i
192.168.10.36
$ host `hostname`
dragon.inside.ntisys.com has address 192.168.10.36
$ host `hostname -i`
36.10.168.192.IN-ADDR.ARPA domain name pointer dragon.inside.ntisys.com
If you saw something like this
$ hostname -f
hostname: Unknown host
or maybe this
$ host `hostname`
foo.bar.com has address 192.168.1.2
$ host `hostname -i`
2.1.168.192.IN-ADDR.ARPA domain name pointer some-other-guy.com
you have a sign of trouble.
--
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or |
| organization. All information is provided without warranty of any kind. |
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************