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

I have a Ubuntu 14.04 Server virtual machine in which I would like to resolve a symbolic name to an IP address locally (i.e., the machine itself should provide the mapping).

The mapping is the following:

mon0 -->

I already have this entry in /etc/hosts:

# file /etc/hosts
[other entries]   mon0

so I can ping mon0 correctly.

What I cannot do is host mon0:

$ host mon0
Host mon0 not found: 3(NXDOMAIN)

From this answer I understand that host is using libresolv rather than gethostbyname (that is way ping works and host doesn't).

I would like to make host mon0 working correctly.

What is a simple solution to achieve this? Since everything is known, static and local, I hope there is no need to run a nameserver :)!

share|improve this question
up vote 1 down vote accepted

Dnsmasq should do exactly what you want and reads your local hosts file.

share|improve this answer
It turns out the solution to my problem was just sudo apt-get install dnsmasq. With the /etc/hosts file already containing the necessary entries, I am now able to resolve the names! Thanks. – Vincenzo Pii Apr 15 '14 at 8:27

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.