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