DragonFly On-Line Manual Pages
HOSTNAME(1) DragonFly General Commands Manual HOSTNAME(1)
hostname -- set or print name of current host system
hostname [-fs] [name-of-host | -r ip-address | -i interface [-6 | -4]]
The hostname utility prints the name of the current host. The super-user
can set the hostname by supplying an argument; this is usually done at
boot time by setting the hostname variable in /etc/rc.conf.
-f Include domain information in the printed name. This is the
-s Trim off any domain information from the printed name.
-r Retrieve hostname via ip lookup. The hostname is set to the first
(official) name returned for the supplied ip address. Can be an
IPv6 or IPv4 address.
-i Retrieve hostname via supplied interface name.
-6 Used in conjunction with -i to select the 1st IPv6 address on the
-4 Used in conjunction with -i to select the 1st IPv4 address on the
interface. This is the default and assumed if -6 or -4 is not sup-
The hostname command appeared in 4.2BSD.
DragonFly 5.5 July 10, 2018 DragonFly 5.5