This is what I normally do but it isn't sufficient:
- Code: Select all
sudo vi /etc/hostname
Delete the old name and setup new name.
- Code: Select all
sudo vi /etc/hosts
Replace any occurrence of the existing computer name with your new one.
When I type
- Code: Select all
hostname
hostnamectl isn't available.
Perhaps someone could point out where the dhcpd config/command lives so we can add the hostname in there?
So far, I found this:
- Code: Select all
# ps aux | grep dhcp
root 1305 0.0 0.3 3652 964 ? Ss 10:11 0:00 /sbin/udhcpc -b -i eth0 -s /etc/api/api_dhcpc.php dhcpdCbScript
We could add -h to add the hostname.
- Code: Select all
-x OPT:VAL Include option OPT in sent packets (cumulative)
Examples of string, numeric, and hex byte opts:
-x hostname:bbox - option 12
-x lease:3600 - option 51 (lease time)
-x 0x3d:0100BEEFC0FFEE - option 61 (client id)
-F,--fqdn NAME Ask server to update DNS mapping for NAME
-C,--clientid-none Don't send MAC as client identifier
I tested this command and it works, the hostname now appears in my router:
- Code: Select all
/sbin/udhcpc -b -i eth0 -s /etc/api/api_dhcpc.php dhcpdCbScript -h MYHOSTNAME
Adding an option to the ifconfig command would work too.
Both are initialised in /etc/init.d/rcS.
The