]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/hostname.xml
travis: use UBSan checks from OSS-Fuzz
[thirdparty/systemd.git] / man / hostname.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
5
6 <refentry id="hostname">
7 <refentryinfo>
8 <title>hostname</title>
9 <productname>systemd</productname>
10 </refentryinfo>
11
12 <refmeta>
13 <refentrytitle>hostname</refentrytitle>
14 <manvolnum>5</manvolnum>
15 </refmeta>
16
17 <refnamediv>
18 <refname>hostname</refname>
19 <refpurpose>Local hostname configuration file</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23 <para><filename>/etc/hostname</filename></para>
24 </refsynopsisdiv>
25
26 <refsect1>
27 <title>Description</title>
28
29 <para>The <filename>/etc/hostname</filename> file configures the
30 name of the local system that is set during boot using the
31 <citerefentry><refentrytitle>sethostname</refentrytitle><manvolnum>2</manvolnum></citerefentry>
32 system call. It should contain a single newline-terminated
33 hostname string. Comments (lines starting with a `#') are ignored.
34 The hostname may be a free-form string up to 64 characters in length;
35 however, it is recommended that it consists only of 7-bit ASCII lower-case
36 characters and no spaces or dots, and limits itself to the format allowed
37 for DNS domain name labels, even though this is not a strict
38 requirement.</para>
39
40 <para>You may use
41 <citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
42 to change the value of this file during runtime from the command
43 line. Use
44 <citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
45 to initialize it on mounted (but not booted) system images.</para>
46 </refsect1>
47
48 <refsect1>
49 <title>History</title>
50
51 <para>The simple configuration file format of
52 <filename>/etc/hostname</filename> originates from Debian
53 GNU/Linux.</para>
54 </refsect1>
55
56 <refsect1>
57 <title>See Also</title>
58 <para>
59 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
60 <citerefentry><refentrytitle>sethostname</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
61 <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
62 <citerefentry><refentrytitle>hostname</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
63 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
64 <citerefentry><refentrytitle>machine-info</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
65 <citerefentry><refentrytitle>hostnamectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
66 <citerefentry><refentrytitle>systemd-hostnamed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
67 <citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
68 </para>
69 </refsect1>
70
71 </refentry>