Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

On my private local network, I need an Ubuntu host to convince itself (well, more specifically the Erlang "long name" tool) that it has a FQDN. It doesn't much matter what it is. But supposing my real host name is apps-dev-01 I'd like hostname -f to return, say, apps-dev-01.internal.

I'm assuming that some combination of /etc/hosts and /etc/resolv.conf manipulation will get me there, but I can't figure out what it is exactly. What is the right way here?

Note, I don't run a DNS server internally, and given how small my network is, I'd rather not take on that hassle.

share|improve this question
up vote 4 down vote accepted

If you have an entry in your /etc/hosts file such as:

your.ip.addr.ess     apps-dev-01

You need to change it to

your.ip.addr.ess     apps-dev-01.internal   apps-dev-01

After that, if you type:

$ hostname -f

You should get the name: apps-dev-01.internal. I am assuming you have the correct config in /etc/nsswitch.conf which gives higher priority for DNS resolution using the hosts file.

That's it!

share|improve this answer
ah that was it. 3-element host entries. – Dan Dec 9 '11 at 19:07

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.