Problem scenario
You run hostname -f
and you get this error: "hostname: Name or service not known"
How do you solve this problem?
Solution
Do these things in this order:
- Verify you have the hostname in the /etc/hostname file.
- Verify the name above matches what is in /etc/hosts for the local IP address.
- Try rebooting the server.
Optionally, to read more about how the results are determined, see click here.