O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

hostname

Synopsis

                  hostname [option] [nameofhost]

Set or print name of current host system. A privileged user can set the hostname with the nameofhost argument.

Options

-a, --alias

Display the alias name of the host (if used).

-d, --domain

Print DNS domain name.

-f, --fqdn, --long

Print fully qualified domain name.

-F file, --file file

Consult file for hostname.

-h, --help

Print a help message and then exit.

-i, --ip-address

Display the IP address(es) of the host.

-n, --node

Display or set the DECnet node name.

-s, --short

Trim domain information from the printed name.

-v, --verbose

Verbose mode.

-V, --version

Print version information and then exit.

-y, --yp, --nis

Display the NIS domain name. A privileged user can set a new NIS domain name with nameofhost.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required