Hostname Not Showing Properly

Operating system Ubuntu Linux 20.04.5
Webmin version 2.001
Virtualmin version 7.2-1 Pro
Kernel and CPU Linux 5.4.0-126-generic on x86_64

I seem to be having issues with the hostname on my server.

Hostname is electra
FQDN is electra.xsxtc.uk

In virtualmin

After a reboot of the server

/etc hostname
electra

/etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.1.1 localhost

The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
77.68.100.23 electra electra.xsxtc.uk

So far so good. However when I run CLI the output is not correct.

[root@electra ~]# hostname
electra
[root@electra ~]# hostname -f
electra
[root@electra ~]# hostname -A
electra electra electra electra

Can anyone tell me what is going on?

Try:

77.68.100.23 electra.xsxtc.uk electra

Thanks Joe,

I changed the order in virtualmin DNS Adresses and got this result:

[root@electra ~]# hostname
electra
[root@electra ~]# hostname -f
electra.xsxtc.uk
[root@electra ~]# hostname -A
electra.xsxtc.uk electra electra electra

Still do not understand why there are four entries in total and three of them (previously all four) are just electra?

Is this a bug that needs to be noted?

Geoff

BTW, it was identical on my second server so I have changed it. Now the FQDN is showing but not the hostname when I use -A:

[root@agamemnon ~]# hostname
agamemnon
[root@agamemnon ~]# hostname -f
agamemnon.ns2.xsxtc.uk
[root@agamemnon ~]# hostname -A
agamemnon.ns2.xsxtc.uk

Geoff

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.