OpenBSD Linux Change Hostname

This post will guide you how to change the hostname of your OpenBSD Linux operating system under the command line option.

You can use the hostname command to display the hostname of your current OpenBSD Linux system. And you need to login the system with root user to set the hostname by editing the hostname config file /etc/myname.

OpenBSD Linux Display Hostname

If you want to display the current hostname of your OpenBSD system, just run the hostname directly under CLI, type:

#hostname

Or you can also check the /etc/myname file to get the current hostname, run the below command:

#cat /etc/myname

OpenBSD Linux Change Hostname

To change the hostname of OpenBSD system, you need to login the system as root firstly, then update the hostname config file.

#1 login the system as root, type the below command

$ su -

#2 edit the config file /etc/myname using vi command, type:

#vi /etc/myname

#3 delete the old hostname line and add new one, just like this:

devops-osetc.com

#4 reboot the system so that the newly hostname will take effect.

#5 update the /etc/hosts file and rename old hostname to new hostname.

 

 

 

You might also like:

Sidebar



back to top