Gentoo Archives: gentoo-user

From: Mike Gilbert <floppym@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] DNS resolver doesn't
Date: Tue, 08 Aug 2017 13:11:52
Message-Id: CAJ0EP42Am3Su7vWxzMiDLBzpjoWpimEF+rW92PD8t11TROSs3w@mail.gmail.com
In Reply to: [gentoo-user] DNS resolver doesn't by Peter Humphrey
1 On Tue, Aug 8, 2017 at 6:19 AM, Peter Humphrey <peter@××××××××××××.uk> wrote:
2 > Hello list,
3 >
4 > On two machines, I have my DSL modem set as DNS server, and it forwards to
5 > my ISP's servers. This works well for external hosts. I also have "order
6 > hosts, bind" in /etc/host.conf, but even though both machines have full LAN
7 > host names and addresses in their /etc/hosts, every DNS lookup goes straight
8 > to the modem, which of course knows nothing of the local layout.
9 >
10 > What else do I have to do to make host.conf effective? Would a hammer help?
11
12 The "order" directive in /etc/host.conf only works for very old
13 versions of glibc. Modern versions use /etc/nsswitch.conf. The default
14 nsswitch.conf will check /etc/hosts (files) before DNS anyway.
15
16 How are you testing? I would guess you are probably using the wrong tool.
17
18 The "host" command will always ignore /etc/hosts. It always does DNS
19 queries by design.
20
21 Try using "getent hosts [hostname]".

Replies

Subject Author
Re: [gentoo-user] DNS resolver doesn't Peter Humphrey <peter@××××××××××××.uk>