OS Manuals

/usr/bin/domainname

Linux networking base tools

From net-tools 2.10-r39 (os), captured 2026-11-05 by running domainname --help (exit 0). permalink

Usage: hostname [-v] {hostname|-F file}      set hostname (from file)
       domainname [-v] {nisdomain|-F file}   set NIS domainname (from file)
       hostname [-v] [-d|-f|-s|-a|-i|-y|-n]  display formatted name
       hostname [-v]                         display hostname

       hostname -V|--version|-h|--help       print info and exit

    dnsdomainname=hostname -d, {yp,nis,}domainname=hostname -y

    -s, --short           short host name
    -a, --alias           alias names
    -i, --ip-address      addresses for the hostname
    -f, --fqdn, --long    long host name (FQDN)
    -d, --domain          DNS domain name
    -y, --yp, --nis       NIS/YP domainname
    -F, --file            read hostname or NIS domainname from given file

   This command can read or set the hostname or the NIS domainname. You can
   also read the DNS domain or the FQDN (fully qualified domain name).
   Unless you are using bind or NIS for host lookups you can change the
   FQDN (Fully Qualified Domain Name) and the DNS domain name (which is
   part of the FQDN) in the /etc/hosts file.
Options (11)
OptionDescriptionSource
-s, --shortDisplay the short host name.help + man
-a, --aliasDisplay the alias name of the host (if used).help + man
-i, --ip-addressDisplay the IP address(es) of the host.help + man
-f, --fqdn, --longDisplay the FQDN (Fully Qualified Domain Name).help + man
-d, --domainDisplay the name of the DNS domain (this is the FQDN without the segment up to the first dot).help + man
-y, --yp, --nisDisplay the NIS domain name.help + man
-F, --file filenameread hostname or NIS domainname from given filehelp + man
-h, --helpPrint a usage message and exit. (in the manual page but not in --help)man
-n, --nodeDisplay the DECnet node name. (in the manual page but not in --help)man
-V, --versionPrint version information on standard output and exit successfully. (in the manual page but not in --help)man
-v, --verboseBe verbose and tell what's going on. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.