OpenBSD Change Hostname

by on May 3, 2008 · 1 comment· LAST UPDATED May 8, 2008


Q. How do I change my hostname under OpenBSD operating system?

A. The hostname command displays the name of the current host. The superuser (root) can set the host name by editing a /etc/myname file. This is used at system boot time by netstart to initialize the hostname.

Task: OpenBSD Display hostname

Type the any one of the following command
# hostname
# cat /etc/myname


Task: OpenBSD Chane Host Name

Simply login as root and type the following command:
# echo "" > /etc/myname
# echo "" > /etc/myname
# echo 'unixbox' > /etc/myname

Tweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?

{ 1 comment… read it below or add one }

1 Michael Kremser April 23, 2014 at 4:24 pm

To make hostname changes effective, one could issue this command:
hostname `cat /etc/myname`


Leave a Comment

Tagged as: , , , , , , , , ,

Previous Faq:

Next Faq: