]> git.proxmox.com Git - systemd.git/blame - man/hostname.html
Imported Upstream version 218
[systemd.git] / man / hostname.html
CommitLineData
663996b3
MS
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hostname</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
f47781d8 22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 218</span><hr><div class="refentry"><a name="hostname"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>hostname — Local hostname configuration file</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename">/etc/hostname</code></p></div><div class="refsect1"><a name="idm140178793752064"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>The <code class="filename">/etc/hostname</code> file
663996b3 23 configures the name of the local system that is set
14228c0d 24 during boot using the
5eef597e 25 <a href="http://man7.org/linux/man-pages/man2/sethostname.2.html"><span class="citerefentry"><span class="refentrytitle">sethostname</span>(2)</span></a>
663996b3 26 system call. It should contain a single
14228c0d
MB
27 newline-terminated hostname string. The
28 hostname may be a free-form string up to 64 characters
29 in length; however, it is recommended that it consists
30 only of 7-bit ASCII lower-case characters and no spaces or dots,
663996b3
MS
31 and limits itself to the format allowed for DNS domain
32 name labels, even though this is not a
14228c0d 33 strict requirement.</p><p>Depending on the operating system, other
663996b3 34 configuration files might be checked for configuration
14228c0d 35 of the hostname as well, however only as fallback.</p><p>You may use
663996b3 36 <a href="hostnamectl.html"><span class="citerefentry"><span class="refentrytitle">hostnamectl</span>(1)</span></a>
5eef597e
MP
37 to change the value of this file during runtime from
38 the command line. Use
39 <a href="systemd-firstboot.html"><span class="citerefentry"><span class="refentrytitle">systemd-firstboot</span>(1)</span></a>
40 to initialize it on mounted (but not booted) system
f47781d8 41 images.</p></div><div class="refsect1"><a name="idm140178793746016"></a><h2 id="History">History<a class="headerlink" title="Permalink to this headline" href="#History">¶</a></h2><p>The simple configuration file format of
663996b3 42 <code class="filename">/etc/hostname</code> originates from
f47781d8 43 Debian GNU/Linux.</p></div><div class="refsect1"><a name="idm140178793744144"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
663996b3 44 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
5eef597e 45 <a href="http://man7.org/linux/man-pages/man2/sethostname.2.html"><span class="citerefentry"><span class="refentrytitle">sethostname</span>(2)</span></a>,
663996b3
MS
46 <a href="hostname.html"><span class="citerefentry"><span class="refentrytitle">hostname</span>(1)</span></a>,
47 <a href="hostname.html"><span class="citerefentry"><span class="refentrytitle">hostname</span>(7)</span></a>,
48 <a href="machine-id.html"><span class="citerefentry"><span class="refentrytitle">machine-id</span>(5)</span></a>,
49 <a href="machine-info.html"><span class="citerefentry"><span class="refentrytitle">machine-info</span>(5)</span></a>,
50 <a href="hostnamectl.html"><span class="citerefentry"><span class="refentrytitle">hostnamectl</span>(1)</span></a>,
5eef597e
MP
51 <a href="systemd-hostnamed.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-hostnamed.service</span>(8)</span></a>,
52 <a href="systemd-firstboot.html"><span class="citerefentry"><span class="refentrytitle">systemd-firstboot</span>(1)</span></a>
663996b3 53 </p></div></div></body></html>