Re: [gentoo-user] DNS resolver doesn't

2017-08-08 Thread Mike Gilbert
On Tue, Aug 8, 2017 at 12:32 PM, Peter Humphrey  wrote:
> On Tuesday 08 Aug 2017 09:11:22 Mike Gilbert wrote:
>
>> 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.
>
> nslookup -sil
>
>> The "host" command will always ignore /etc/hosts. It always does DNS
>> queries by design.
>>
>> Try using "getent hosts [hostname]".
>
> Yes, that works. Thanks Mike. I'll set up a nice short alias for it. Looks
> like I can get rid of net-dns/bind-tools.

bind-tools is quite useful for performing advanced DNS queries. The
'dig' command is especially useful if you want to see the full rrset
being returned. It also lets you set various flags on the DNS request,
and manually override the DNS server.

For casual usage, bind-tools is probably unnecessary.



Re: [gentoo-user] DNS resolver doesn't

2017-08-08 Thread Peter Humphrey
On Tuesday 08 Aug 2017 09:11:22 Mike Gilbert wrote:

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

nslookup -sil
 
> The "host" command will always ignore /etc/hosts. It always does DNS
> queries by design.
> 
> Try using "getent hosts [hostname]".

Yes, that works. Thanks Mike. I'll set up a nice short alias for it. Looks 
like I can get rid of net-dns/bind-tools.

-- 
Regards
Peter




Re: [gentoo-user] DNS resolver doesn't

2017-08-08 Thread Mike Gilbert
On Tue, Aug 8, 2017 at 6:19 AM, Peter Humphrey  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]".



[gentoo-user] DNS resolver doesn't

2017-08-08 Thread Peter Humphrey
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?

-- 
Regards
Peter