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.

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

1 Answer 1

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 at 8:27

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.