Why is hostname and $HOSTNAME different?

Bo Berglund bo.berglund at gmail.com
Wed May 11 18:07:33 UTC 2022


On Wed, 11 May 2022 10:06:55 -0700, Tom Mitchell <niftyubuntu at niftyegg.com>
wrote:

>DHCP can set a lot of parameters so review that machine as well.
>The local DHCP client can accept, ignore  or override.
>
Well, as part of mt router reconfigurationfrom factory settings I had to do the
DHCP reservations too.
Since these are based on MAC addresses the "Host Name" column is optional and I
used it as an identification sticker to define which device hot which IP
address.
In the case of the Ubuntu server I entered "ubuntusrv" when the actual computer
host name is set to "ubuntuserv".
I did not even think about it as something that could be transferred to the
device itself...

But obviously this is what happened.

Sometimes I could set this for two entries to the same device (Ethernet and
WiFi):
rpi4dev-eth
rpi4dev-wifi

when the device's host name internally is rpi4dev.

So this cannot be used anymore, obviously.


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list