I modified my /etc/hostname file and /etc/hosts like that:


and       localhost.localdomain localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters hostname.com

after that I run hostname hostname.com

now when I run hostname -f the result is:


Where did I go wrong?


I think you might need to put your unqualified domain name (hostname) in /etc/hostname and your fully qualified domain name (hostname.com) as the first entry after in /etc/hosts. I'm not sure what the ip address is but I think this line should be removed. This askbuntu question might help clarify, although I'm still not certain how you've got those results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.