Commands

hostname

[-v] [-a] [--alias] [-d] [--domain] [-f] [--fqdn] [-i] [--ip-address] [--long] [-s] [--short] [-y] [--yp] [--nis]

hostname

[-v] [-F filename] [--file filename] [hostname]

domainname

[-v] [-F filename] [--file filename] [name]

hostname

[-v] [-h] [--help] [-V] [--version]

dnsdomainname

[-v]

nisdomainname

[-v]

ypdomainname

[-v]

This program will either set or display the specified network name. Note that you cannot change the FQDN with this command.

Example: To set the domain name of the current domain to be asgard, use

domainname asgard

-a, --alias Displays alias name of host.
-d, --domain Displays DNS domain name.
-F, --file

Get Linux® Desk Reference, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.