If you are using the DHCP (Dynamic Host Configuration Protocol) service on a FreeBSD system and you are having trouble setting the hostname permanently, there are a few things you can try:
Check the DHCP configuration: Make sure that the DHCP server is configured to set the hostname for the client. The DHCP server should send the hostname in the host-name
option of the DHCP offer message.
Check the client configuration: Make sure that the FreeBSD client is configured to use the hostname provided by the DHCP server. You can check the client configuration by looking at the file /etc/rc.conf
. The hostname
variable should be set to dhcp
:
hostname="dhcp"
hostname
script in the /etc/rc.d
directory. Make sure that the script is executable and that it is being run at boot time. You can check the script by running the following command:cat /etc/rc.d/hostname
/etc/resolv.conf
file is correct and that the nameservers listed in the file are reachable.