[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Needless DNS queries



On 6/8/22, Greg Wooledge <greg@wooledge.org> wrote:
> On Wed, Jun 08, 2022 at 12:56:52AM +0000, Lee wrote:
>> host and dig are non-standard.  or use non-standard name lookups?
>> library??
>> In any case, try your example with ping or ssh - the search list will
>> be applied after the initial NXDOMAIN
>
> On Debian, the canonical tool for performing generic hostname lookups
> according to the rules established by /etc/nsswitch.conf and other
> local system config files would be:
>
> getent hosts NAME
>
> unicorn:~$ getent hosts www.google.com.
> 2607:f8b0:4009:80b::2004 www.google.com
> unicorn:~$ host www.google.com
> www.google.com has address 142.250.190.100
> www.google.com has IPv6 address 2607:f8b0:4009:80b::2004
>
> (Demonstrating the difference between canonical and useful.  My system
> has no IPv6 capability.)

I'm in the same boat :(  Verizon _still_ hasn't rolled out IPv6 in my area.

I like having DNSSEC enabled, so I'm running bind locally; here's the
bits from the bind log (with an 'rndc flush' between queries to clear
out any cached info)

$ getent hosts www.google.com
query: www.google.com IN AAAA + (127.0.0.1)

$ ping www.google.com
query: www.google.com IN A + (127.0.0.1)
query: www.google.com IN AAAA + (127.0.0.1)

$ host www.google.com
query: www.google.com IN A + (127.0.0.1)
query: www.google.com IN AAAA + (127.0.0.1)
query: www.google.com IN MX + (127.0.0.1)

Why getent doesn't look for an IPv4 address I don't know.  Same for
host .. no idea why it goes looking for an MX record.  Ping, ssh,
telnet all look for an IPv4 and an IPv6 address.   hrmm... Firefox
only looks for an ipv4 address ... ah! right - because I've got
network.dns.disableIPv6 set to true

I was under the impression there was a standard method for doing the
name -> address lookup but it seems that host, dig and even getent do
something non-standard - maybe to give you more control for debugging
purposes?

Lee


Reply to: