HOSTNAME(1)

NAME
hostname - display/set the hostname
domainname - display/set the Yellow Pages (NIS) domain
ypdomainname - display/set the Yellow Pages (NIS) domain

SYNOPSIS
hostname [hostname] hostname [-sfd?]
hostname [--host, --fqdn, --domain, --help]
(yp)domainname [Yellow Pages domain]

DESCRIPTION
Hostname shows or sets the system's hostname. Domainname and ypdomainname show or set the system's Yellow Pages domain name. When displaying the current hostname, you can change what part of the hostname you see:

-s, --host
Show only the host-part of a fully qualified domain name.

-f, --fqdn
Show the fully qualified domain name.  This option works in
    strange ways; if the fully qualified domain name is your hostname, it simply displays it. If your hostname is simply that -- the hostname without the dns domain appended -- hostname attempts to look up your dns domain and return that. If it can't find a dns domain for your host, it returns nothing.

-d, --domain
Show just the dns domain part of the hostname;  it behaves like
    --fqdn when attempting to display the dns domain of a hostname that doesn't include one.

-?, --help
Give a help message, then exit.

-V, --version
Show the version of this copy of
    B hostname, then exit.

EXAMPLES
If your machine has the hostname of pell, hostname returns pell; hostname -fqdn attempts a dns lookup for pell, then returns the results of that lookup. If your machine has the hostname of pell.stpaul.mn.us, hostname returns pell; hostname --fqdn returns pell.stpaul.mn.us, and hostname --domain returns stpaul.mn.us.

SEE ALSO
uname(1). gethostname(2), sethostname(2), getdomainname(2), setdomainname(2)

AUTHOR
David Parsons ( orc@pell.chi.il.us )