I have defined the server's FQDN and its alias in /etc/hosts
:
X.X.X.X server1.example.com server1
However, the command hostname --fqdn
only returns the alias (server1
) and not the FQDN. Why is that?
I have defined the server's FQDN and its alias in /etc/hosts
:
X.X.X.X server1.example.com server1
However, the command hostname --fqdn
only returns the alias (server1
) and not the FQDN. Why is that?
Have you changed /etc/hostname
also? Did you restarted the network services after that change?
invoke-rc.d hostname.sh start
invoke-rc.d networking force-reload
invoke-rc.d network-manager force-reload
Without them, the server will still use the older one.
More info can be found here.