On Tue, Aug 8, 2017 at 6:19 AM, Peter Humphrey <pe...@prh.myzen.co.uk> wrote:
> Hello list,
> On two machines, I have my DSL modem set as DNS server, and it forwards to
> my ISP's servers. This works well for external hosts. I also have "order
> hosts, bind" in /etc/host.conf, but even though both machines have full LAN
> host names and addresses in their /etc/hosts, every DNS lookup goes straight
> to the modem, which of course knows nothing of the local layout.
> What else do I have to do to make host.conf effective? Would a hammer help?

The "order" directive in /etc/host.conf only works for very old
versions of glibc. Modern versions use /etc/nsswitch.conf. The default
nsswitch.conf will check /etc/hosts (files) before DNS anyway.

How are you testing? I would guess you are probably using the wrong tool.

The "host" command will always ignore /etc/hosts. It always does DNS
queries by design.

Try using "getent hosts [hostname]".

Reply via email to