Re: [dmarc-ietf] DNS library queries for DKIM and DMARC records?

Scott Kitterman <sklist@kitterman.com> Thu, 11 April 2019 04:42 UTC

Return-Path: <sklist@kitterman.com>
X-Original-To: dmarc@ietfa.amsl.com
Delivered-To: dmarc@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D081412023C for <dmarc@ietfa.amsl.com>; Wed, 10 Apr 2019 21:42:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=kitterman.com header.b=J6u32ufY; dkim=pass (2048-bit key) header.d=kitterman.com header.b=V5W39qNr
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 GLCC26E6JGGa for <dmarc@ietfa.amsl.com>; Wed, 10 Apr 2019 21:42:53 -0700 (PDT)
Received: from interserver.kitterman.com (interserver.kitterman.com [64.20.48.66]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 064E91201A8 for <dmarc@ietf.org>; Wed, 10 Apr 2019 21:42:52 -0700 (PDT)
Received: from interserver.kitterman.com (interserver.kitterman.com [64.20.48.66]) by interserver.kitterman.com (Postfix) with ESMTPS id F0160F80486 for <dmarc@ietf.org>; Thu, 11 Apr 2019 00:42:51 -0400 (EDT)
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=kitterman.com; i=@kitterman.com; q=dns/txt; s=201903e; t=1554957771; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type : from; bh=dBtRl+KqYBmBL5B1zdSX28tnGDkNOIMfq3sYIbsSF/c=; b=J6u32ufYDgw3pjugHoCHI5kh1svbsyNU/DLKCPvKDGeMxhjUWO8oKIWN E0z4bvJ60OR6FKY4tqNPQw0M9NtbCQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kitterman.com; i=@kitterman.com; q=dns/txt; s=201903r; t=1554957771; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type : from; bh=dBtRl+KqYBmBL5B1zdSX28tnGDkNOIMfq3sYIbsSF/c=; b=V5W39qNrkAPs2YPHqoSekygsSvJK0ucSKjUwP252pulxBeO3oLn6bjEy t4SUDYPDKdYq2V1evFekOKSwaDqL1K4lFc0WB4Vbxp5EcLaWZVDeDs5lmQ iP75zQNH1ACy7Rl0mAXJ0Icmd7nymSnIpYyQ0JEcA1Lmr8NEGLecaXa06e /RhVpWU6TMjWF+FHgDFtKerIoLlfVm2jsMdxF1ovb4t7O6mQnJYkU1PscR kmxk2mUM7YlpE4Ek+utMVWInuagotRhrQnojIg0mwkcHYtMY8gj/XUIl18 ydn0+N+R6YxXhQS7ZFGYhpGrNfTbObHVsKM50K7hHBlWDa2DkKSZDA==
Received: from kitterma-e6430.localnet (static-72-81-252-22.bltmmd.fios.verizon.net [72.81.252.22]) by interserver.kitterman.com (Postfix) with ESMTPSA id C0362F8038A for <dmarc@ietf.org>; Thu, 11 Apr 2019 00:42:51 -0400 (EDT)
From: Scott Kitterman <sklist@kitterman.com>
To: dmarc@ietf.org
Date: Thu, 11 Apr 2019 00:42:50 -0400
Message-ID: <25082821.JLSd9BuZku@kitterma-e6430>
User-Agent: KMail/4.13.3 (Linux/3.13.0-164-generic; KDE/4.13.3; x86_64; ; )
In-Reply-To: <4298318.26pBuaHoxp@kitterma-e6430>
References: <571ce243-a8b0-094d-0d59-06f1432bd741@gmail.com> <b8667ee0-d0c5-6bc2-c20e-1150ce910133@gmail.com> <4298318.26pBuaHoxp@kitterma-e6430>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dmarc/Ty7BzpoaV6wIhuplEP0q9Od6Zuc>
Subject: Re: [dmarc-ietf] DNS library queries for DKIM and DMARC records?
X-BeenThere: dmarc@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Domain-based Message Authentication, Reporting, and Compliance \(DMARC\)" <dmarc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dmarc>, <mailto:dmarc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dmarc/>
List-Post: <mailto:dmarc@ietf.org>
List-Help: <mailto:dmarc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dmarc>, <mailto:dmarc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 11 Apr 2019 04:42:55 -0000

On Thursday, April 11, 2019 12:29:28 AM Scott Kitterman wrote:
> On Wednesday, April 10, 2019 09:16:56 PM Dave Crocker wrote:
> > On 4/10/2019 8:37 PM, Scott Kitterman wrote:
> > >>>> print(response.additional)
> > > 
> > > []
> > 
> > Turns out that's what I was especially hoping to see.
> 
> Great.  I checked and dnspython can do that too:
> >>> import dns.resolver
> >>> a = dns.resolver.query('google.com', dns.rdatatype.TXT)
> >>> print(a.response.additional)
> 
> []

And just for fun python-getdns [1] has an even more interesting result to that 
same query:

{'additional': [{'do': 1, 'extended_rcode': 0, 'rdata': {}, 'type': 41, 
'udp_payload_size': 65535, 'version': 0, 'z': 0}]

As far as I know, the unbound python bindings don't do TXT, so that's all the 
Python libs I know about.

Scott K

[1] https://github.com/getdnsapi/getdns-python-bindings