]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/hostname.xml
verify: use manager_load_startable_unit_or_warn() to load units for verification
[thirdparty/systemd.git] / man / hostname.xml
CommitLineData
6a7e63ef 1<?xml version='1.0'?> <!--*-nxml-*-->
6a7e63ef 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6a7e63ef
LP
4
5<!--
572eb058
ZJS
6 SPDX-License-Identifier: LGPL-2.1+
7
6a7e63ef
LP
8 This file is part of systemd.
9
10 Copyright 2010 Lennart Poettering
11
12 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
6a7e63ef
LP
15 (at your option) any later version.
16
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 20 Lesser General Public License for more details.
6a7e63ef 21
5430f7f2 22 You should have received a copy of the GNU Lesser General Public License
6a7e63ef
LP
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24-->
25
26<refentry id="hostname">
798d3a52
ZJS
27 <refentryinfo>
28 <title>hostname</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>hostname</refentrytitle>
43 <manvolnum>5</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>hostname</refname>
48 <refpurpose>Local hostname configuration file</refpurpose>
49 </refnamediv>
50
51 <refsynopsisdiv>
52 <para><filename>/etc/hostname</filename></para>
53 </refsynopsisdiv>
54
55 <refsect1>
56 <title>Description</title>
57
58 <para>The <filename>/etc/hostname</filename> file configures the
59 name of the local system that is set during boot using the
60 <citerefentry><refentrytitle>sethostname</refentrytitle><manvolnum>2</manvolnum></citerefentry>
61 system call. It should contain a single newline-terminated
139e5336
MP
62 hostname string. Comments (lines starting with a `#') are ignored.
63 The hostname may be a free-form string up to 64 characters in length;
64 however, it is recommended that it consists only of 7-bit ASCII lower-case
65 characters and no spaces or dots, and limits itself to the format allowed
66 for DNS domain name labels, even though this is not a strict
67 requirement.</para>
798d3a52 68
798d3a52
ZJS
69 <para>You may use
70 <citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
71 to change the value of this file during runtime from the command
72 line. Use
73 <citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
74 to initialize it on mounted (but not booted) system images.</para>
75 </refsect1>
76
77 <refsect1>
78 <title>History</title>
79
80 <para>The simple configuration file format of
81 <filename>/etc/hostname</filename> originates from Debian
82 GNU/Linux.</para>
83 </refsect1>
84
85 <refsect1>
86 <title>See Also</title>
87 <para>
88 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
89 <citerefentry><refentrytitle>sethostname</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
90 <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
91 <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
92 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
93 <citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
94 <citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
95 <citerefentry><refentrytitle>systemd-hostnamed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
96 <citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
97 </para>
98 </refsect1>
6a7e63ef
LP
99
100</refentry>