diff options
author | Bob Halley <halley@dnspython.org> | 2012-04-08 13:55:36 +0100 |
---|---|---|
committer | Bob Halley <halley@dnspython.org> | 2012-04-08 13:55:36 +0100 |
commit | ea13fd9c21194a54055326bf6f5219d1e983641f (patch) | |
tree | 7469c1e1a71cb544baeaf2015425870f48f79fb1 | |
parent | 0f8559141f589ad112ead7c1ae1432d3b2dbfe4b (diff) | |
download | dnspython-ea13fd9c21194a54055326bf6f5219d1e983641f.tar.gz |
allow all EDNS parameters to be specifed when making a query
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | dns/message.py | 16 |
3 files changed, 19 insertions, 2 deletions
@@ -1,5 +1,8 @@ 2012-04-08 Bob Halley <halley@dnspython.org> + * dns/message.py (make_query): All EDNS values may now be + specified when calling make_query() + * dns/query.py: Specifying source_port had no effect if source was not specified. We now use the appropriate wildcard source in that case. @@ -49,6 +49,8 @@ New since 1.9.4: A source port can be specified when creating a resolver query. + All EDNS values may now be specified to dns.message.make_query(). + Bugs fixed since 1.9.4: IPv4 and IPv6 address processing is now stricter. diff --git a/dns/message.py b/dns/message.py index 70c836a..52c0eae 100644 --- a/dns/message.py +++ b/dns/message.py @@ -1022,7 +1022,8 @@ def from_file(f): return m def make_query(qname, rdtype, rdclass = dns.rdataclass.IN, use_edns=None, - want_dnssec=False): + want_dnssec=False, ednsflags=0, payload=1280, + request_payload=None, options=None): """Make a query message. The query name, type, and class may all be specified either @@ -1043,6 +1044,17 @@ def make_query(qname, rdtype, rdclass = dns.rdataclass.IN, use_edns=None, @type use_edns: int or bool or None @param want_dnssec: Should the query indicate that DNSSEC is desired? @type want_dnssec: bool + @param ednsflags: EDNS flag values. + @type ednsflags: int + @param payload: The EDNS sender's payload field, which is the maximum + size of UDP datagram the sender can handle. + @type payload: int + @param request_payload: The EDNS payload size to use when sending + this message. If not specified, defaults to the value of payload. + @type request_payload: int or None + @param options: The EDNS options + @type options: None or list of dns.edns.Option objects + @see: RFC 2671 @rtype: dns.message.Message object""" if isinstance(qname, (str, unicode)): @@ -1055,7 +1067,7 @@ def make_query(qname, rdtype, rdclass = dns.rdataclass.IN, use_edns=None, m.flags |= dns.flags.RD m.find_rrset(m.question, qname, rdclass, rdtype, create=True, force_unique=True) - m.use_edns(use_edns) + m.use_edns(use_edns, ednsflags, payload, request_payload, options) m.want_dnssec(want_dnssec) return m |