FreeBSD Change Hostname without reboot

To change the hostname of a FreeBSD system without rebooting, you can use the hostname command. To set the hostname to “new-hostname”, you can run the following command:

hostname new-hostname

To make the change permanent, you will need to edit the /etc/rc.conf file and modify the hostname variable. For example:

vi /etc/rc.conf

# Change the line:
# hostname="old-hostname"
# to:
hostname="new-hostname"

Save the changes and exit the file, then run the following command to update the hostname in the running system:

service hostname start

This will change the hostname of the system without requiring a reboot.

Leave a Comment