O'Reilly logo

Absolute OpenBSD, 2nd Edition by Michael W. Lucas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required