I'm sure this is trivial but all the info I've found online has been too vague to help me sort it.
If I want a Linux box (Ubuntu/Debian) to have the FQDN of mybox.example.com, where do I set it?
I understand that /etc/hostname should contain the "mybox" bit, but where does example.com go?
I would expect the following queries and responses hostname -d Should give "example.com", gives "" (empty string) hostname -s Should give "mybox", and does hostname --fqdn Should give "mybox.example.com", gives "mybox"
I even managed to get "hostname -s" to return "mybox.example.com" earlier, although I can't now reproduce it.
NB: I do know that after changing /etc/hostname I need to run hostname -F /etc/hostname
Mark Rogers wrote:
If I want a Linux box (Ubuntu/Debian) to have the FQDN of mybox.example.com, where do I set it?
Fixed it!
They key was that /etc/hosts (or my DNS) needed to be configured to give the correct reverse lookup of the IP address. In my case I already had 192.168.10.1 mybox mybox.example.com .. in there, but I needed to reverse the order to give me 192.168.10.1 mybox.example.com mybox