MirBSD manpage: hostname(1)

HOSTNAME(1)                  BSD Reference Manual                  HOSTNAME(1)


     hostname - set or print name of current host system


     hostname [-fs] [name-of-host]


     The hostname utility prints the name of the current host. The superuser
     can set the host name by supplying a /etc/myname file. This is used at
     system boot time by netstart(8) to initialise the hostname.

     The options are as follows:

     -f      Returns what the DNS resolver thinks the hostname canonicalises
             to. This is usually the "official host name" of the first line in
             /etc/hosts whose official host name or alias matches the name of
             the current host, but can also be retrieved from DNS.

     -s      Trims off any domain information from the printed name.


     /etc/hosts   The host name database.
     /etc/myname  Configuration file containing the fully qualified host name
                  (FQDN), to be set at system boot time.


     getaddrinfo(3), gethostname(3), sethostname(3), hosts(5), myname(5),
     hostname(7), netstart(8)


     The hostname utility appeared in 4.2BSD. The -f option appeared in
     MirBSD #11, inspired by the GNU version of hostname.

MirBSD #10-current             January 24, 2021                              1

Generated on 2022-12-24 01:00:14 by $MirOS: src/scripts/roff2htm,v 1.113 2022/12/21 23:14:31 tg Exp $ — This product includes material provided by mirabilos.

These manual pages and other documentation are copyrighted by their respective writers; their sources are available at the project’s CVSweb, AnonCVS and other mirrors. The rest is Copyright © 2002–2022 MirBSD.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.

Kontakt / Impressum & Datenschutzerklärung