Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I run the command hostname (on Ubuntu 10.04 LTS Server) it returns ''

When I run hostname -f I get 'mail' as a response.

These seem backwards to me, shouldn't hostname -f return the FQDN? Where did I misconfigure this?

share|improve this question
Please posts the contents of /etc/hosts and /etc/resolv.conf. – sciurus Jul 25 '11 at 2:44
up vote 1 down vote accepted

Yes, hostname -f should return the FQDN. Try:

  • In /etc/hostname put the "short" hostname (mail).
  • In /etc/resolv.conf put domain

There are probably other ways to do it; that's just how I have my system configured (and it seems to work).

share|improve this answer
The changes to /etc/hostname worked beautifully. When running hostname -f I still only get mail instead of the FQDN. I did add domain to resolv.conf as well. (Rebooted for good measure to test too. :) – Citricguy Jul 25 '11 at 2:45
I think the next step would be to check /etc/hosts and add an entry there, if appropriate. Let us know! – fission Jul 25 '11 at 2:47
Had to add the entry to hosts as well mail :) Thank you for the help, couldn't have done this without you! – Citricguy Jul 25 '11 at 2:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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