@@ -29,63 +29,16 @@ as its methods and attributes.
29
29
30
30
The :class: `Context ` class has the following public read/write attributes:
31
31
32
- .. py :attribute :: resolution_type
33
-
34
- Specifies whether DNS queries are performed with
35
- nonrecursive lookups or as a stub resolver. The value is
36
- either ``getdns.RESOLUTION_RECURSING `` or
37
- ``getdns.RESOLUTION_STUB ``.
38
-
39
- If an implementation of this API is only able to act as a
40
- recursive resolver, setting `resolution_type `
41
- to ``getdns.RESOLUTION_STUB `` will throw an exception.
42
-
43
- .. py :attribute :: namespaces
44
-
45
- The `namespaces ` attribute takes an ordered list of
46
- namespaces that will be queried. (*Important: this context
47
- setting is ignored for the getdns.general() function;
48
- it is used for the other
49
- functions. *) The allowed values are
50
- ``getdns.NAMESPACE_DNS ``, ``getdns.NAMESPACE_LOCALNAMES ``,
51
- ``getdns.NAMESPACE_NETBIOS ``,
52
- ``getdns.NAMESPACE_MDNS ``, and ``getdns.NAMESPACE_NIS ``. When a
53
- normal lookup is done, the API does the lookups in the
54
- order given and stops when it gets the first result; a
55
- different method with the same result would be to run the
56
- queries in parallel and return when it gets the first
57
- result. Because lookups might be done over different
58
- mechanisms because of the different namespaces, there can
59
- be information leakage that is similar to that seen with
60
- POSIX *getaddrinfo() *. The default is determined by the OS.
61
-
62
- .. py :attribute :: dns_transport_list
63
-
64
- An ordered list of transport options to be used for DNS
65
- lookups, ordered by preference (first choice as list
66
- element 0, second as list element 1, and so on). The
67
- possible values are ``getdns.TRANSPORT_UDP ``,
68
- ``getdns.TRANSPORT_TCP ``, ``getdns.TRANSPORT_TLS ``,
69
- and ``getdns.TRANSPORT_STARTTLS ``. [n.b.: *the
70
- ``dns_transport`` attribute is still supported but will
71
- be deprecated in a future release *]
72
-
73
- .. py :attribute :: limit_outstanding_queries
74
-
75
- Specifies `limit ` (an integer value) on the number of outstanding DNS
76
- queries. The API will block itself from sending more
77
- queries if it is about to exceed this value, and instead
78
- keep those queries in an internal queue. The a value of 0
79
- indicates that the number of outstanding DNS queries is unlimited.
80
-
81
- .. py :attribute :: follow_redirects
32
+ .. py :attribute :: append_name
82
33
83
- Specifies whether or not DNS queries follow
84
- redirects. The value must be one of ``getdns.REDIRECTS_FOLLOW `` for
85
- normal following of redirects though CNAME and DNAME; or
86
- ``getdns.REDIRECTS_DO_NOT_FOLLOW `` to cause any lookups that
87
- would have gone through CNAME and DNAME to return the
88
- CNAME or DNAME, not the eventual target.
34
+ Specifies whether to append a suffix to the query string
35
+ before the API starts resolving a name. Its value must be
36
+ one of
37
+ ``getdns.APPEND_NAME_ALWAYS ``,
38
+ ``getdns.APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE ``,
39
+ ``getdns.APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE ``,
40
+ or ``getdns.APPEND_NAME_NEVER ``. This controls whether or not
41
+ to append the suffix given by :attr: `suffix `.
89
42
90
43
.. py :attribute :: dns_root_servers
91
44
@@ -104,58 +57,130 @@ as its methods and attributes.
104
57
... { ' address_data' : ' 65.22.9.1' , ' address_type' : ' IPv4' } ]
105
58
>>> mycontext.dns_root_servers = addrs
106
59
107
- .. py :attribute :: append_name
60
+ .. py :attribute :: dns_transport_list
108
61
109
- Specifies whether to append a suffix to the query string
110
- before the API starts resolving a name. Its value must be
111
- one of
112
- ``getdns.APPEND_NAME_ALWAYS ``,
113
- ``getdns.APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE ``,
114
- ``getdns.APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE ``,
115
- or ``getdns.APPEND_NAME_NEVER ``. This controls whether or not
116
- to append the suffix given by :attr: `suffix `.
62
+ An ordered list of transport options to be used for DNS
63
+ lookups, ordered by preference (first choice as list
64
+ element 0, second as list element 1, and so on). The
65
+ possible values are ``getdns.TRANSPORT_UDP ``,
66
+ ``getdns.TRANSPORT_TCP ``, ``getdns.TRANSPORT_TLS ``,
67
+ and ``getdns.TRANSPORT_STARTTLS ``.
117
68
118
- .. py :attribute :: suffix
69
+ .. py :attribute :: dnssec_allowed_skew
119
70
120
- Its value is a list of strings to be appended based on
121
- :attr: ` append_name `. The list elements must
122
- follow the rules in :rfc: ` 4343#section-2.1 `
71
+ Its value is the number of seconds of skew that is
72
+ allowed in either direction when checking an RRSIG's
73
+ Expiration and Inception fields. The default is 0.
123
74
124
75
.. py :attribute :: dnssec_trust_anchors
125
76
126
77
Its value is a list of DNSSEC trust anchors, expressed as
127
78
RDATAs from DNSKEY resource records.
128
79
129
- .. py :attribute :: dnssec_allowed_skew
80
+ .. py :attribute :: edns_client_subnet_private
130
81
131
- Its value is the number of seconds of skew that is
132
- allowed in either direction when checking an RRSIG's
133
- Expiration and Inception fields. The default is 0.
82
+ May be set to 0 or 1. When 1, requests upstreams not to
83
+ reveal query's originating network.
134
84
135
- .. py :attribute :: edns_maximum_udp_payload_size
85
+ .. py :attribute :: edns_do_bit
136
86
137
- Its value must be an integer between 512 and 65535,
138
- inclusive. The default is 512.
87
+ Its value must be an integer valued either 0 or 1. The default is 0.
139
88
140
89
.. py :attribute :: edns_extended_rcode
141
90
142
91
Its value must be an integer between 0 and 255, inclusive.
143
92
The default is 0.
144
93
94
+ .. py :attribute :: edns_maximum_udp_payload_size
95
+
96
+ Its value must be an integer between 512 and 65535,
97
+ inclusive. The default is 512.
98
+
145
99
.. py :attribute :: edns_version
146
100
147
101
Its value must be an integer between 0 and 255, inclusive.
148
102
The default is 0.
149
103
150
- .. py :attribute :: edns_do_bit
104
+ .. py :attribute :: follow_redirects
151
105
152
- Its value must be an integer valued either 0 or 1. The default is 0.
106
+ Specifies whether or not DNS queries follow
107
+ redirects. The value must be one of ``getdns.REDIRECTS_FOLLOW `` for
108
+ normal following of redirects though CNAME and DNAME; or
109
+ ``getdns.REDIRECTS_DO_NOT_FOLLOW `` to cause any lookups that
110
+ would have gone through CNAME and DNAME to return the
111
+ CNAME or DNAME, not the eventual target.
112
+
113
+ .. py :attribute :: idle_timeout
114
+
115
+ The idle timeout for TCP connections.
116
+
117
+ .. py :attribute :: implementation_string
118
+
119
+ A string describing the implementation of the underlying
120
+ getdns library, retrieved from
121
+ libgetdns. Currently "https://getdnsapi.net"
122
+
123
+ .. py :attribute :: limit_outstanding_queries
124
+
125
+ Specifies `limit ` (an integer value) on the number of outstanding DNS
126
+ queries. The API will block itself from sending more
127
+ queries if it is about to exceed this value, and instead
128
+ keep those queries in an internal queue. The a value of 0
129
+ indicates that the number of outstanding DNS queries is unlimited.
130
+
131
+ .. py :attribute :: namespaces
132
+
133
+ The `namespaces ` attribute takes an ordered list of
134
+ namespaces that will be queried. (*Important: this context
135
+ setting is ignored for the getdns.general() function;
136
+ it is used for the other
137
+ functions. *) The allowed values are
138
+ ``getdns.NAMESPACE_DNS ``, ``getdns.NAMESPACE_LOCALNAMES ``,
139
+ ``getdns.NAMESPACE_NETBIOS ``,
140
+ ``getdns.NAMESPACE_MDNS ``, and ``getdns.NAMESPACE_NIS ``. When a
141
+ normal lookup is done, the API does the lookups in the
142
+ order given and stops when it gets the first result; a
143
+ different method with the same result would be to run the
144
+ queries in parallel and return when it gets the first
145
+ result. Because lookups might be done over different
146
+ mechanisms because of the different namespaces, there can
147
+ be information leakage that is similar to that seen with
148
+ POSIX *getaddrinfo() *. The default is determined by the OS.
149
+
150
+ .. py :attribute :: resolution_type
151
+
152
+ Specifies whether DNS queries are performed with
153
+ nonrecursive lookups or as a stub resolver. The value is
154
+ either ``getdns.RESOLUTION_RECURSING `` or
155
+ ``getdns.RESOLUTION_STUB ``.
156
+
157
+ If an implementation of this API is only able to act as a
158
+ recursive resolver, setting `resolution_type `
159
+ to ``getdns.RESOLUTION_STUB `` will throw an exception.
160
+
161
+ .. py :attribute :: suffix
162
+
163
+ Its value is a list of strings to be appended based on
164
+ :attr: `append_name `. The list elements must
165
+ follow the rules in :rfc: `4343#section-2.1 `
153
166
154
167
.. py :attribute :: timeout
155
168
156
169
Its value must be an integer specifying a timeout for a query, expressed
157
170
in milliseconds.
158
171
172
+ .. py :attribute :: tls_authentication
173
+
174
+ The mechanism to be used for authenticating the TLS
175
+ server when using a TLS transport. May be ``getdns.AUTHENTICATION_HOSTNAME `` or
176
+ ``getdns.AUTHENTICATION_NONE ``.
177
+
178
+ .. py :attribute :: tls_query_padding_blocksize
179
+
180
+ Optional padding blocksize for queries when using TLS. Used to
181
+ increase the difficulty for observers to guess traffic
182
+ content.
183
+
159
184
.. py :attribute :: upstream_recursive_servers
160
185
161
186
A list of dicts defining where a stub resolver will send queries.
@@ -168,6 +193,10 @@ as its methods and attributes.
168
193
tsig_algorithm (a bindata) that is the name of the TSIG hash
169
194
algorithm, and tsig_secret (a bindata) that is the TSIG key.
170
195
196
+ .. py :attribute :: version_string
197
+
198
+ The libgetdns version, retrieved from the underlying
199
+ getdns library.
171
200
172
201
The :class: `Context ` class includes public methods to execute a DNS query, as well as a
173
202
method to return the entire set of context attributes as a Python dictionary. :class: `Context `
@@ -243,6 +272,10 @@ as its methods and attributes.
243
272
* ``timeout ``
244
273
* ``upstream_recursive_servers ``
245
274
275
+ .. py :method :: get_supported_attributes()
276
+
277
+ Returns a list of the attributes supported by this
278
+ Context object.
246
279
247
280
The ``getdns `` module has the following read-only attribute:
248
281
0 commit comments