{
    "content": [
        {
            "type": "text",
            "text": "# domainname(1) (man)\n\n**Summary:** hostname - show or set the system's host name domainname - show or set the system's NIS/YP domain name ypdomainname - show or set the system's NIS/YP domain name nisdomainname - show or set the system's NIS/YP domain name dnsdomainname - show the system's DNS domain name\n\n**Synopsis:** hostname  [-a|--alias]  [-d|--domain]  [-f|--fqdn|--long]  [-A|--all-fqdns] [-i|--ip-address]\n[-I|--all-ip-addresses] [-s|--short] [-y|--yp|--nis]\nhostname [-b|--boot] [-F|--file filename] [hostname]\nhostname [-h|--help] [-V|--version]\ndomainname [nisdomain] [-F file]\nypdomainname [nisdomain] [-F file]\nnisdomainname [nisdomain] [-F file]\n\n## Section Outline\n\n- **NAME** (7 lines)\n- **SYNOPSIS** (9 lines) — 1 subsections\n  - dnsdomainname (1 lines)\n- **DESCRIPTION** (59 lines)\n- **OPTIONS** (57 lines)\n- **NOTES** (5 lines)\n- **FILES** (7 lines)\n- **AUTHORS** (7 lines)\n\n## Full Content\n\n### NAME\n\nhostname - show or set the system's host name\ndomainname - show or set the system's NIS/YP domain name\nypdomainname - show or set the system's NIS/YP domain name\nnisdomainname - show or set the system's NIS/YP domain name\ndnsdomainname - show the system's DNS domain name\n\n### SYNOPSIS\n\nhostname  [-a|--alias]  [-d|--domain]  [-f|--fqdn|--long]  [-A|--all-fqdns] [-i|--ip-address]\n[-I|--all-ip-addresses] [-s|--short] [-y|--yp|--nis]\nhostname [-b|--boot] [-F|--file filename] [hostname]\nhostname [-h|--help] [-V|--version]\n\ndomainname [nisdomain] [-F file]\nypdomainname [nisdomain] [-F file]\nnisdomainname [nisdomain] [-F file]\n\n#### dnsdomainname\n\n### DESCRIPTION\n\nHostname is used to display the system's DNS name, and to display or set its hostname or  NIS\ndomain name.\n\n\nGET NAME\nWhen called without any arguments, the program displays the current names:\n\nhostname will print the name of the system as returned by the gethostname(2) function.\n\ndomainname  will  print the NIS domainname of the system.  domainname uses the gethostname(2)\nfunction, while ypdomainname and nisdomainname use the getdomainname(2).\n\ndnsdomainname will print the domain part of the FQDN (Fully Qualified Domain Name). The  com‐\nplete  FQDN  of  the system is returned with hostname --fqdn (but see the warnings in section\nTHE FQDN below).\n\n\nSET NAME\nWhen called with one argument or with the --file option, the commands set the  host  name  or\nthe  NIS/YP  domain  name.  hostname uses the sethostname(2) function, while all of the three\ndomainname, ypdomainname and nisdomainname use setdomainname(2).  Note, that this  is  effec‐\ntive only until the next reboot.  Edit /etc/hostname for permanent change.\n\nNote, that only the super-user can change the names.\n\nIt is not possible to set the FQDN or the DNS domain name with the dnsdomainname command (see\nTHE FQDN below).\n\nThe host name is usually set once at system startup in /etc/init.d/hostname.sh  (normally  by\nreading the contents of a file which contains the host name, e.g.  /etc/hostname).\n\n\nTHE FQDN\nThe FQDN (Fully Qualified Domain Name) of the system is the name that the resolver(3) returns\nfor the host name, such as, ursula.example.com.  It is usually the hostname followed  by  the\nDNS domain name (the part after the first dot).  You can check the FQDN using hostname --fqdn\nor the domain name using dnsdomainname.\n\nYou cannot change the FQDN with hostname or dnsdomainname.\n\nThe recommended method of setting the FQDN is to make the hostname be an alias for the  fully\nqualified  name using /etc/hosts, DNS, or NIS. For example, if the hostname was \"ursula\", one\nmight have a line in /etc/hosts which reads\n\n127.0.1.1    ursula.example.com ursula\n\nTechnically: The FQDN is the name getaddrinfo(3) returns for the host name returned by  geth‐‐\nostname(2).  The DNS domain name is the part after the first dot.\n\nTherefore it depends on the configuration of the resolver (usually in /etc/host.conf) how you\ncan change it. Usually the hosts file is parsed before DNS or NIS, so it is  most  common  to\nchange the FQDN in /etc/hosts.\n\nIf  a  machine  has multiple network interfaces/addresses or is used in a mobile environment,\nthen it may either have multiple FQDNs/domain names or none at  all.  Therefore  avoid  using\nhostname  --fqdn,  hostname  --domain and dnsdomainname.  hostname --ip-address is subject to\nthe same limitations so it should be avoided as well.\n\n### OPTIONS\n\n-a, --alias\nDisplay the alias name of the host (if used). This option is deprecated and should not\nbe used anymore.\n\n-A, --all-fqdns\nDisplays  all  FQDNs of the machine. This option enumerates all configured network ad‐\ndresses on all configured network interfaces, and translates them to DNS domain names.\nAddresses  that cannot be translated (i.e. because they do not have an appropriate re‐\nverse IP entry) are skipped. Note that different addresses may  resolve  to  the  same\nname,  therefore the output may contain duplicate entries. Do not make any assumptions\nabout the order of the output.\n\n-b, --boot\nAlways set a hostname; this allows the file specified by  -F  to  be  non-existent  or\nempty, in which case the default hostname localhost will be used if none is yet set.\n\n-d, --domain\nDisplay  the  name of the DNS domain.  Don't use the command domainname to get the DNS\ndomain name because it will show the NIS domain name and not the DNS domain name.  Use\ndnsdomainname  instead.  See  the  warnings in section THE FQDN above, and avoid using\nthis option.\n\n-f, --fqdn, --long\nDisplay the FQDN (Fully Qualified Domain Name). A FQDN consists of a short  host  name\nand  the  DNS  domain  name. Unless you are using bind or NIS for host lookups you can\nchange the FQDN and the DNS domain name (which is part of the FQDN) in the  /etc/hosts\nfile.  See the warnings in section THE FQDN above und use hostname --all-fqdns instead\nwherever possible.\n\n-F, --file filename\nRead the host name from the specified file. Comments (lines starting with a  `#')  are\nignored.\n\n-i, --ip-address\nDisplay  the  network  address(es)  of the host name. Note that this works only if the\nhost name can be resolved. Avoid using this option;  use  hostname  --all-ip-addresses\ninstead.\n\n-I, --all-ip-addresses\nDisplay  all  network addresses of the host. This option enumerates all configured ad‐\ndresses on all network interfaces. The loopback  interface  and  IPv6  link-local  ad‐\ndresses  are omitted. Contrary to option -i, this option does not depend on name reso‐\nlution. Do not make any assumptions about the order of the output.\n\n-s, --short\nDisplay the short host name. This is the host name cut at the first dot.\n\n-V, --version\nPrint version information on standard output and exit successfully.\n\n-y, --yp, --nis\nDisplay the NIS domain name. If a parameter is given (or --file name ) then  root  can\nalso set a new NIS domain.\n\n-h, --help\nPrint a usage message and exit.\n\n### NOTES\n\nThe  address  families hostname tries when looking up the FQDN, aliases and network addresses\nof the host are determined by the configuration of your resolver.  For instance, on GNU  Libc\nsystems,  the  resolver can be instructed to try IPv6 lookups first by using the inet6 option\nin /etc/resolv.conf.\n\n### FILES\n\n/etc/hostname Historically this file was supposed to only contain the hostname  and  not  the\nfull  canonical FQDN. Nowadays most software is able to cope with a full FQDN here. This file\nis read at boot time by the system initialization scripts to set the hostname.\n\n/etc/hosts Usually, this is where one sets the domain name by aliasing the host name  to  the\nFQDN.\n\n### AUTHORS\n\nPeter Tobias, <tobias@et-inf.fho-emden.de>\nBernd Eckenfels, <net-tools@lina.inka.de> (NIS and manpage).\nMichael Meskes, <meskes@debian.org>\n\n\n\nnet-tools                                    2009-09-16                                  HOSTNAME(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "domainname",
        "section": "1",
        "mode": "man",
        "summary": "hostname - show or set the system's host name domainname - show or set the system's NIS/YP domain name ypdomainname - show or set the system's NIS/YP domain name nisdomainname - show or set the system's NIS/YP domain name dnsdomainname - show the system's DNS domain name",
        "synopsis": "hostname  [-a|--alias]  [-d|--domain]  [-f|--fqdn|--long]  [-A|--all-fqdns] [-i|--ip-address]\n[-I|--all-ip-addresses] [-s|--short] [-y|--yp|--nis]\nhostname [-b|--boot] [-F|--file filename] [hostname]\nhostname [-h|--help] [-V|--version]\ndomainname [nisdomain] [-F file]\nypdomainname [nisdomain] [-F file]\nnisdomainname [nisdomain] [-F file]",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": [
                    {
                        "name": "dnsdomainname",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DESCRIPTION",
                "lines": 59,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 57,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 7,
                "subsections": []
            }
        ]
    }
}