systemd/man/hostname.html
2015-02-17 11:22:16 +01:00

50 lines
4.2 KiB
HTML

<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>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</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="idm140466949530736"></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 configures the
name of the local system that is set during boot using the
<a href="http://man7.org/linux/man-pages/man2/sethostname.2.html"><span class="citerefentry"><span class="refentrytitle">sethostname</span>(2)</span></a>
system call. It should contain a single newline-terminated
hostname string. The hostname may be a free-form string up to 64
characters in length; however, it is recommended that it consists
only of 7-bit ASCII lower-case characters and no spaces or dots,
and limits itself to the format allowed for DNS domain name
labels, even though this is not a strict requirement.</p><p>Depending on the operating system, other configuration files
might be checked for configuration of the hostname as well,
however only as fallback.</p><p>You may use
<a href="hostnamectl.html"><span class="citerefentry"><span class="refentrytitle">hostnamectl</span>(1)</span></a>
to change the value of this file during runtime from the command
line. Use
<a href="systemd-firstboot.html"><span class="citerefentry"><span class="refentrytitle">systemd-firstboot</span>(1)</span></a>
to initialize it on mounted (but not booted) system images.</p></div><div class="refsect1"><a name="idm140466949524832"></a><h2 id="History">History<a class="headerlink" title="Permalink to this headline" href="#History"></a></h2><p>The simple configuration file format of
<code class="filename">/etc/hostname</code> originates from Debian
GNU/Linux.</p></div><div class="refsect1"><a name="idm140466949522912"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
<a href="http://man7.org/linux/man-pages/man2/sethostname.2.html"><span class="citerefentry"><span class="refentrytitle">sethostname</span>(2)</span></a>,
<a href="hostname.html"><span class="citerefentry"><span class="refentrytitle">hostname</span>(1)</span></a>,
<a href="hostname.html"><span class="citerefentry"><span class="refentrytitle">hostname</span>(7)</span></a>,
<a href="machine-id.html"><span class="citerefentry"><span class="refentrytitle">machine-id</span>(5)</span></a>,
<a href="machine-info.html"><span class="citerefentry"><span class="refentrytitle">machine-info</span>(5)</span></a>,
<a href="hostnamectl.html"><span class="citerefentry"><span class="refentrytitle">hostnamectl</span>(1)</span></a>,
<a href="systemd-hostnamed.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-hostnamed.service</span>(8)</span></a>,
<a href="systemd-firstboot.html"><span class="citerefentry"><span class="refentrytitle">systemd-firstboot</span>(1)</span></a>
</p></div></div></body></html>