1

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 --> 127.0.0.1

I already have this entry in /etc/hosts:

# file /etc/hosts
[other entries]
127.0.1.1   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 why 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 :)!

1 Answer 1

1

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

1
  • 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. Apr 15, 2014 at 8:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .