A
A
Andrey Prokopyuk2014-02-05 14:19:36
Domain Name System
Andrey Prokopyuk, 2014-02-05 14:19:36

Ubuntu 13.10: why is /etc/hosts being ignored again?

This topic has already been raised, I studied many options for resolving the issue, but none of them gave a result, the file is ignored.
So the key files are:

andre@Andre-PC:~$ sudo cat /etc/hosts
127.0.0.1	localhost test.local test.localdomain
127.0.1.1	Andre-PC

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

andre@Andre-PC:~$ sudo cat /etc/nsswitch.conf 
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
andre@Andre-PC:~$ sudo cat /etc/host.conf 
# The "order" line is only used by old versions of the C library.
order hosts,bind
multi on
andre@Andre-PC:~$

We try to access the described hosts:
andre@Andre-PC:~$ ping Andre-PC
ping: unknown host Andre-PC
andre@Andre-PC:~$ ping test.local
ping: unknown host test.local
andre@Andre-PC:~$ ping test.localdomain
ping: unknown host test.localdomain
andre@Andre-PC:~$

What additional dances with a tambourine were undertaken:
  • Comment out dns=dnsmasqin NetworkManager.conf. dnsmasq doesn't start, but the result is the same.
  • Add an entry with host test.local to /etc/avahi/hosts, stopping avahi-daemon. To no avail.

For someone, as I read, this problem magically corrected itself, but that was in 12.04 LTS, in 13.10 this feature, apparently, was cut out.
What else can be checked?
UPD.
Removing dnsmasq is not possible, it is a dependency of the Network manager. It is installed by default, in the form of the dnsmasq-base package. But this, by and large, will not give any advantages compared to disabling it.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikolai Vasilchuk, 2014-02-05
@Anonym

Why do you have dnsmasq installed?
Delete and everything will work.
While it should work, it just needs a (maybe) restart of dnsmasq.

S
sevkin, 2014-02-13
@sevkin

echo "addn-hosts=/etc/hosts" >/etc/NetworkManager/dnsmasq.d/hosts.conf

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question