Hostname

Set the system’s hostname in /etc/myname. My test system is called caddis.blackhelicopters.org.

$ cat /etc/myname
caddis.blackhelicopters.org

To change the hostname, edit /etc/myname. The new hostname takes effect after the next reboot.

To change the hostname until the next boot, use hostname -s and the new hostname, like this:

# hostname -s treble.blackhelicopters.org
# hostname
treble.blackhelicopters.org

You can edit /etc/myname and run hostname -s to make a change take effect immediately and persist after the next boot.

Get Absolute OpenBSD, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.