{
    "content": [
        {
            "type": "text",
            "text": "# hostname(5) (man)\n\n**Summary:** hostname - Local hostname configuration file\n\n**Synopsis:** /etc/hostname\n\n## See Also\n\n- systemd(1)\n- sethostname(2)\n- machine-id(5)\n- machine-info(5)\n- hostnamectl(1)\n- systemd-hostnamed.service(8)\n- systemd-firstboot(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (14 lines)\n- **HOSTNAME SEMANTICS** (23 lines)\n- **HISTORY** (2 lines)\n- **SEE ALSO** (3 lines)\n- **NOTES** (6 lines)\n\n## Full Content\n\n### NAME\n\nhostname - Local hostname configuration file\n\n### SYNOPSIS\n\n/etc/hostname\n\n### DESCRIPTION\n\nThe /etc/hostname file configures the name of the local system. Unless overridden as\ndescribed in the next section, systemd(1) will set this hostname during boot using the\nsethostname(2) system call.\n\nThe file should contain a single newline-terminated hostname string. Comments (lines starting\nwith a \"#\") are ignored. The hostname should be composed of up to 64 7-bit ASCII lower-case\nalphanumeric characters or hyphens forming a valid DNS domain name. It is recommended that\nthis name contains only a single label, i.e. without any dots. Invalid characters will be\nfiltered out in an attempt to make the name valid, but obviously it is recommended to use a\nvalid name and not rely on this filtering.\n\nYou may use hostnamectl(1) to change the value of this file during runtime from the command\nline. Use systemd-firstboot(1) to initialize it on mounted (but not booted) system images.\n\n### HOSTNAME SEMANTICS\n\nsystemd(1) and the associated tools will obtain the hostname in the following ways:\n\n•   If the kernel commandline parameter systemd.hostname= specifies a valid hostname,\nsystemd(1) will use it to set the hostname during early boot, see kernel-command-line(7),\n\n•   Otherwise, the \"static\" hostname specified by /etc/hostname as described above will be\nused.\n\n•   Otherwise, a transient hostname may be set during runtime, for example based on\ninformation in a DHCP lease, see systemd-hostnamed.service(8). Both NetworkManager[1] and\nsystemd-networkd.service(8) allow this. Note that systemd-hostnamed.service(8) gives\nhigher priority to the static hostname, so the transient hostname will only be used if\nthe static hostname is not configured.\n\n•   Otherwise, a fallback hostname configured at compilation time will be used (\"localhost\").\n\nEffectively, the static hostname has higher priority than a transient hostname, which has\nhigher priority than the fallback hostname. Transient hostnames are equivalent, so setting a\nnew transient hostname causes the previous transient hostname to be forgotten. The hostname\nspecified on the kernel command line is like a transient hostname, with the exception that it\nhas higher priority when the machine boots. Also note that those are the semantics\nimplemented by systemd tools, but other programs may also set the hostname.\n\n### HISTORY\n\nThe simple configuration file format of /etc/hostname originates from Debian GNU/Linux.\n\n### SEE ALSO\n\nsystemd(1), sethostname(2), hostname(1), hostname(7), machine-id(5), machine-info(5),\nhostnamectl(1), systemd-hostnamed.service(8), systemd-firstboot(1)\n\n### NOTES\n\n1. NetworkManager\nhttps://developer.gnome.org/NetworkManager/stable/\n\n\n\nsystemd 249                                                                              HOSTNAME(5)\n\n"
        }
    ],
    "structuredContent": {
        "command": "hostname",
        "section": "5",
        "mode": "man",
        "summary": "hostname - Local hostname configuration file",
        "synopsis": "/etc/hostname",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "systemd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
            },
            {
                "name": "sethostname",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/sethostname/2/json"
            },
            {
                "name": "machine-id",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/machine-id/5/json"
            },
            {
                "name": "machine-info",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/machine-info/5/json"
            },
            {
                "name": "hostnamectl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/hostnamectl/1/json"
            },
            {
                "name": "systemd-hostnamed.service",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-hostnamed.service/8/json"
            },
            {
                "name": "systemd-firstboot",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-firstboot/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "HOSTNAME SEMANTICS",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}