Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.