diff options
| author | Bob Halley <halley@nominum.com> | 2012-04-08 13:55:48 +0100 |
|---|---|---|
| committer | Bob Halley <halley@nominum.com> | 2012-04-08 13:55:48 +0100 |
| commit | a4d93d43c34dc4d956dd4406ce730d5c9977c003 (patch) | |
| tree | 8f55f70133787b29ba23298c3c398f7dbdf5a8c5 | |
| parent | 4d26315313c188502f44de17914f5905744f8f15 (diff) | |
| download | dnspython-a4d93d43c34dc4d956dd4406ce730d5c9977c003.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 e78ec50..85096f3 100644 --- a/dns/message.py +++ b/dns/message.py @@ -1016,7 +1016,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 @@ -1037,6 +1038,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): @@ -1049,7 +1061,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 |
