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 :)!

Vincenzo Pii
  • 147
  • 1
  • 6

1 Answers1

1

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

user9517
  • 115,471
  • 20
  • 215
  • 297
  • 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 08:27