Re: [DNSOP] Why would a v4 client send AAAA query?

Mukund Sivaraman <muks@mukund.org> Thu, 29 August 2019 12:46 UTC

Return-Path: <muks@mukund.org>
X-Original-To: dnsop@ietfa.amsl.com
Delivered-To: dnsop@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 475521200F1 for <dnsop@ietfa.amsl.com>; Thu, 29 Aug 2019 05:46:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=mukund.org
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JyV3CR2ghhzp for <dnsop@ietfa.amsl.com>; Thu, 29 Aug 2019 05:46:36 -0700 (PDT)
Received: from mail.akira.org (mail.akira.org [88.198.135.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 07A4212004A for <dnsop@ietf.org>; Thu, 29 Aug 2019 05:46:35 -0700 (PDT)
Received: from jurassic.lan.banu.com (unknown [60.243.81.75]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.akira.org (Postfix) with ESMTPSA id 66EE2790009A; Thu, 29 Aug 2019 12:46:32 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mukund.org; s=mail; t=1567082793; bh=u40Pi61scua98jLgU4JPg5yxZ8sQDimmsR0eSr9wSqY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gvh/bE//EkpBN0PYtMZtxm0LWX11v3gnmAFGRyj3HmqDZyjAtIP/9+q/JqFPjd2vT PJU0vSjmdS3TYiq29AqDjayBAPdYv/ldSAehbG8K2Zgxnc5QJIom2NiZMtHvrEPf3n hcW3mx9ieU1BDk/uTm8T2TindKDBglN+U4acC0xQ=
Date: Thu, 29 Aug 2019 18:15:05 +0530
From: Mukund Sivaraman <muks@mukund.org>
To: Naveen Kottapalli <naveen.sarma@gmail.com>
Cc: dnsop@ietf.org
Message-ID: <20190829124505.GA442@jurassic.lan.banu.com>
References: <CANFmOtkrB=Z6HNyJ7SFinMAHJEgOB=J0KQnKxYqy_7kPYPbumg@mail.gmail.com> <20190829063910.GB90696@straasha.imrryr.org> <CANFmOt=_DqDNziVQh=5bF7yC-6DwPFPMYTz7kud7EwjsEFdY5Q@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CANFmOt=_DqDNziVQh=5bF7yC-6DwPFPMYTz7kud7EwjsEFdY5Q@mail.gmail.com>
User-Agent: Mutt/1.12.0 (2019-05-25)
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnsop/diEQD2hlmjOB4HU0vpYp4A2Qj_Y>
Subject: Re: [DNSOP] Why would a v4 client send AAAA query?
X-BeenThere: dnsop@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: IETF DNSOP WG mailing list <dnsop.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnsop>, <mailto:dnsop-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dnsop/>
List-Post: <mailto:dnsop@ietf.org>
List-Help: <mailto:dnsop-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnsop>, <mailto:dnsop-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Aug 2019 12:46:38 -0000

On Thu, Aug 29, 2019 at 03:13:45PM +0530, Naveen Kottapalli wrote:
> My query was about the behavior we observed on a gateway where a pure v4
> subscriber (not dual-stack) has sent both A and AAAA query for the same
> domain simultaneously.  Just wanted to know why would a pure v4 subscriber
> which cannot use the resolved AAAA domain addresses is trying to resolve
> the v6 addresses of the domain.

As Viktor pointed out, when a process calls getaddrinfo() without hints,
some libc implementations of getaddrinfo() don't consider what address
families the system has configured as it doesn't matter at that library
interface.

For example, here is FreeBSD's getaddrinfo() implementation:

https://github.com/freebsd/freebsd/blob/master/lib/libc/net/getaddrinfo.c#L2301

So, for example, FreeBSD's ping which uses gethostbyname2() with AF_INET
will appear to lookup only the A record of a hostname being pinged,
whereas FreeBSD's telnet which uses getaddrinfo() without hints (which
gets converted internally to AF_UNSPEC) will appear to lookup both A and
AAAA records.

Also what Mark said applies that even if you think a subscriber has no
v6 address/stack, they probably do.

		Mukund