0

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?

Onion
  • 119
  • 6
  • Is the `127.0.1.1` entry still defined in hosts file with the short name? Is your server using the `127.0.1.1` option? By default debian will setup the /etc/hosts with an entry like `127.0.1.1 fully.quallified.tld shortname`. – Zoredache Oct 09 '14 at 17:24

1 Answers1

2

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.

ThoriumBR
  • 5,302
  • 2
  • 24
  • 34