summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/hostname.1
blob: 661ca1c048e2307e5fe35164a658f1cf7bfc9449 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.\" Copyright (c) 1992, Sun Microsystems, Inc.
.\" Copyright 2016 Joyent, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.Dd Aug 26, 2016
.Dt HOSTNAME 1
.Os
.Sh NAME
.Nm hostname
.Nd set or print name of current host system
.Sh SYNOPSIS
.Nm
.Op Fl s
.Op Ar name-of-host
.Sh DESCRIPTION
The
.Nm
command prints the name of the current host, as given before the
.Xr login 1
prompt.
The super-user can set the hostname by giving
.Ar name-of-host .
.Pp
While setting the hostname changes the hostname for the running system,
it does not persist the change.
The proper way to update the hostname will vary depending on how the
system is configured.
For most systems, the persistent hostname is stored in the file
.Pa /etc/nodename .
See
.Xr nodename 5
for more information on how to update it.
Note, the
.Pa /etc/nodename
file may be ignored in cases where the system is configured to use DHCP.
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl s
Prints only the part of the hostname preceding the first dot.
.El
.Sh SEE ALSO
.Xr uname 1 ,
.Xr nodename 5 ,
.Xr attributes 7