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