]> git.proxmox.com Git - systemd.git/blame - man/hostnamectl.1
Imported Upstream version 220
[systemd.git] / man / hostnamectl.1
CommitLineData
14228c0d 1'\" t
e3bff60a 2.TH "HOSTNAMECTL" "1" "" "systemd 220" "hostnamectl"
14228c0d
MB
3.\" -----------------------------------------------------------------
4.\" * Define some portability stuff
5.\" -----------------------------------------------------------------
6.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7.\" http://bugs.debian.org/507673
8.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10.ie \n(.g .ds Aq \(aq
11.el .ds Aq '
12.\" -----------------------------------------------------------------
13.\" * set default formatting
14.\" -----------------------------------------------------------------
15.\" disable hyphenation
16.nh
17.\" disable justification (adjust text to left margin only)
18.ad l
19.\" -----------------------------------------------------------------
20.\" * MAIN CONTENT STARTS HERE *
21.\" -----------------------------------------------------------------
22.SH "NAME"
23hostnamectl \- Control the system hostname
24.SH "SYNOPSIS"
25.HP \w'\fBhostnamectl\fR\ 'u
26\fBhostnamectl\fR [OPTIONS...] {COMMAND}
27.SH "DESCRIPTION"
28.PP
29\fBhostnamectl\fR
30may be used to query and change the system hostname and related settings\&.
31.PP
e842803a 32This tool distinguishes three different hostnames: the high\-level "pretty" hostname which might include all kinds of special characters (e\&.g\&. "Lennart\*(Aqs Laptop"), the static hostname which is used to initialize the kernel hostname at boot (e\&.g\&. "lennarts\-laptop"), and the transient hostname which is a default received from network configuration\&. If a static hostname is set, and is valid (something other than localhost), then the transient hostname is not used\&.
14228c0d
MB
33.PP
34Note that the pretty hostname has little restrictions on the characters used, while the static and transient hostnames are limited to the usually accepted characters of Internet domain names\&.
35.PP
36The static hostname is stored in
37/etc/hostname, see
38\fBhostname\fR(5)
39for more information\&. The pretty hostname, chassis type, and icon name are stored in
40/etc/machine\-info, see
5eef597e
MP
41\fBmachine-info\fR(5)\&.
42.PP
43Use
44\fBsystemd-firstboot\fR(1)
45to initialize the system host name for mounted (but not booted) system images\&.
14228c0d
MB
46.SH "OPTIONS"
47.PP
48The following options are understood:
49.PP
14228c0d
MB
50\fB\-\-no\-ask\-password\fR
51.RS 4
52Do not query the user for authentication for privileged operations\&.
53.RE
54.PP
14228c0d
MB
55\fB\-\-static\fR, \fB\-\-transient\fR, \fB\-\-pretty\fR
56.RS 4
57If
58\fBstatus\fR
59is used (or no explicit command is given) and one of those fields is given,
60\fBhostnamectl\fR
61will print out just this selected hostname\&.
62.sp
63If used with
64\fBset\-hostname\fR, only the selected hostname(s) will be updated\&. When more than one of those options is used, all the specified hostnames will be updated\&.
65.RE
66.PP
60f067b4
JS
67\fB\-H\fR, \fB\-\-host=\fR
68.RS 4
e842803a
MB
69Execute the operation remotely\&. Specify a hostname, or a username and hostname separated by
70"@", to connect to\&. The hostname may optionally be suffixed by a container name, separated by
71":", which connects directly to a specific container on the specified host\&. This will use SSH to talk to the remote machine manager instance\&. Container names may be enumerated with
72\fBmachinectl \-H \fR\fB\fIHOST\fR\fR\&.
60f067b4
JS
73.RE
74.PP
f47781d8
MP
75\fB\-M\fR, \fB\-\-machine=\fR
76.RS 4
77Execute operation on a local container\&. Specify a container name to connect to\&.
78.RE
79.PP
60f067b4
JS
80\fB\-h\fR, \fB\-\-help\fR
81.RS 4
82Print a short help text and exit\&.
83.RE
84.PP
85\fB\-\-version\fR
86.RS 4
87Print a short version string and exit\&.
88.RE
89.PP
14228c0d
MB
90The following commands are understood:
91.PP
92\fBstatus\fR
93.RS 4
94Show current system hostname and related information\&.
95.RE
96.PP
5eef597e 97\fBset\-hostname \fR\fB\fINAME\fR\fR
14228c0d 98.RS 4
5eef597e
MP
99Set the system hostname to
100\fINAME\fR\&. By default, this will alter the pretty, the static, and the transient hostname alike; however, if one or more of
14228c0d
MB
101\fB\-\-static\fR,
102\fB\-\-transient\fR,
103\fB\-\-pretty\fR
104are used, only the selected hostnames are changed\&. If the pretty hostname is being set, and static or transient are being set as well, the specified hostname will be simplified in regards to the character set used before the latter are updated\&. This is done by replacing spaces with
105"\-"
5eef597e
MP
106and removing special characters\&. This ensures that the pretty and the static hostname are always closely related while still following the validity rules of the specific name\&. This simplification of the hostname string is not done if only the transient and/or static host names are set, and the pretty host name is left untouched\&.
107.sp
108Pass the empty string
14228c0d
MB
109""
110as the hostname to reset the selected hostnames to their default (usually
111"localhost")\&.
112.RE
113.PP
5eef597e 114\fBset\-icon\-name \fR\fB\fINAME\fR\fR
14228c0d 115.RS 4
5eef597e
MP
116Set the system icon name to
117\fINAME\fR\&. The icon name is used by some graphical applications to visualize this host\&. The icon name should follow the
118\m[blue]\fBIcon Naming Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
119.sp
120Pass an empty string to reset the icon name to the default value, which is determined from chassis type (see below) and possibly other parameters\&.
14228c0d
MB
121.RE
122.PP
5eef597e 123\fBset\-chassis \fR\fB\fITYPE\fR\fR
14228c0d 124.RS 4
5eef597e
MP
125Set the chassis type to
126\fITYPE\fR\&. The chassis type is used by some graphical applications to visualize the host or alter user interaction\&. Currently, the following chassis types are defined:
14228c0d
MB
127"desktop",
128"laptop",
129"server",
130"tablet",
5eef597e 131"handset",
f47781d8 132"watch",
e735f4d4 133"embedded", as well as the special chassis types
14228c0d
MB
134"vm"
135and
136"container"
5eef597e
MP
137for virtualized systems that lack an immediate physical chassis\&.
138.sp
139Pass an empty string to reset the chassis type to the default value which is determined from the firmware and possibly other parameters\&.
140.RE
141.PP
142\fBset\-deployment \fR\fB\fIENVIRONMENT\fR\fR
143.RS 4
144Set the deployment environment description\&.
145\fIENVIRONMENT\fR
146must be a single word without any control characters\&. One of the following is suggested:
147"development",
148"integration",
149"staging",
150"production"\&.
151.sp
152Pass an empty string to reset to the default empty value\&.
153.RE
154.PP
155\fBset\-location \fR\fB\fILOCATION\fR\fR
156.RS 4
157Set the location string for the system, if it is known\&.
158\fILOCATION\fR
159should be a human\-friendly, free\-form string describing the physical location of the system, if it is known and applicable\&. This may be as generic as
160"Berlin, Germany"
161or as specific as
162"Left Rack, 2nd Shelf"\&.
163.sp
164Pass an empty string to reset to the default empty value\&.
14228c0d
MB
165.RE
166.SH "EXIT STATUS"
167.PP
60f067b4 168On success, 0 is returned, a non\-zero failure code otherwise\&.
14228c0d
MB
169.SH "SEE ALSO"
170.PP
171\fBsystemd\fR(1),
172\fBhostname\fR(1),
173\fBhostname\fR(5),
174\fBmachine-info\fR(5),
175\fBsystemctl\fR(1),
5eef597e
MP
176\fBsystemd-hostnamed.service\fR(8),
177\fBsystemd-firstboot\fR(1)
14228c0d
MB
178.SH "NOTES"
179.IP " 1." 4
180Icon Naming Specification
181.RS 4
182\%http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
183.RE