From: Bob Halley Date: Sun, 7 Nov 2021 18:29:40 +0000 (-0800) Subject: update RD=0 example now that we have a flags parameter X-Git-Tag: v2.2.0rc1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03b94513d17119dfcb708886197c81293cce7be0;p=thirdparty%2Fdnspython.git update RD=0 example now that we have a flags parameter --- diff --git a/examples/query_specific.py b/examples/query_specific.py index fcbfc241..c82207c1 100644 --- a/examples/query_specific.py +++ b/examples/query_specific.py @@ -36,12 +36,13 @@ print('The nameservers are:') for rr in answer: print(rr.target) -# Sending a query with the RD flag set to 0 -# This sends a query with RD=0 for the root SOA RRset to the IP address for l.root-servers.net +# Sending a query with the all flags set to 0. This is the easiest way +# to make a query with the RD flag off. +# +# This sends a query with RD=0 for the root SOA RRset to the IP address +# for l.root-servers.net. -q = dns.message.make_query('.', dns.rdatatype.SOA) -# Set the RD flag to 0 -q.flags &= ~dns.flags.RD +q = dns.message.make_query('.', dns.rdatatype.SOA, flags=0) r = dns.query.udp(q, '199.7.83.42') print('\nThe flags in the response are {}'.format(dns.flags.to_text(r.flags))) print('The SOA in the response is "{}"'.format((r.answer)[0][0]))