3

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.

Dan
  • 143
  • 6

1 Answers1

6

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!

Khaled
  • 36,533
  • 8
  • 72
  • 99