@@ -10,7 +10,7 @@ getdns: Python bindings for getdns
1010for the `getdns <http://getdnsapi.net/ >`_ API. getdns is a
1111modern, asynchronous DNS API that simplifies access to
1212advanced DNS features, including DNSSEC. The API
13- `specification <http://www.vpnc.org/getdns-api / >`_ was
13+ `specification <http://getdnsapi.net/spec / >`_ was
1414developed by Paul Hoffman. getdns is built on top of the
1515getdns implementation developed as a joint project between
1616`Verisign Labs
@@ -29,7 +29,7 @@ This version of getdns has been built and tested against Python
29292.7. We also expect these other prerequisites to be
3030installed:
3131
32- * `libgetdns <http://getdnsapi.net/ >`_, version 0.1.2 or later
32+ * `libgetdns <http://getdnsapi.net/ >`_, version 0.1.7 or later
3333* `libldns <https://www.nlnetlabs.nl/projects/ldns/ >`_,
3434 version 1.6.11 or later
3535* `libunbound
@@ -45,7 +45,7 @@ as follows:
4545
4646 ./configure --with-libevent
4747
48- This release has been tested against libgetdns 0.1.5 .
48+ This release has been tested against libgetdns 0.1.7 .
4949
5050Building
5151========
@@ -86,7 +86,7 @@ examined directly, and the overall state of a given context can be
8686queried with the Context.get_api_information() method.
8787
8888See section 8 of the `API
89- specification <http://www.vpnc.org/getdns-api /> `_
89+ specification <http://getdnsapi.net/spec /> `_
9090
9191
9292Examples
@@ -105,20 +105,21 @@ results to the screen:
105105 sys.exit(1 )
106106
107107 ctx = getdns.Context()
108- extensions = { " return_both_v4_and_v6" : getdns.GETDNS_EXTENSION_TRUE }
109- results = ctx.address(name = sys.argv[1 ], extensions = extensions)
110- if results[" status" ] == getdns.GETDNS_RESPSTATUS_GOOD :
108+ extensions = { " return_both_v4_and_v6" :
109+ getdns.GETDNS_EXTENSION_TRUE }
110+ results = ctx.address(name = sys.argv[1 ],
111+ extensions = extensions)
112+ if results.status == getdns.RESPSTATUS_GOOD :
111113 sys.stdout.write(" Addresses: " )
112-
113- for addr in results[ " just_address_answers" ] :
114+
115+ for addr in results. just_address_answers:
114116 print " {0} " .format(addr[" address_data" ])
115117 sys.stdout.write(" \n\n " )
116118 print " Entire results tree: "
117- pprint.pprint(results)
118- if results[ " status" ] == getdns.GETDNS_RESPSTATUS_NO_NAME :
119+ pprint.pprint(results.replies_tree )
120+ if results. status == getdns.RESPSTATUS_NO_NAME :
119121 print " {0} not found" .format(sys.argv[1 ])
120122
121-
122123 if __name__ == " __main__" :
123124 main()
124125
@@ -149,27 +150,31 @@ In this example, we do a DNSSEC query and check the response:
149150 sys.exit(1 )
150151
151152 ctx = getdns.Context()
152- extensions = { " return_both_v4_and_v6" : getdns.GETDNS_EXTENSION_TRUE ,
153- " dnssec_return_status" : getdns.GETDNS_EXTENSION_TRUE }
154- results = ctx.address(name = sys.argv[1 ], extensions = extensions)
155- if results[" status" ] == getdns.GETDNS_RESPSTATUS_GOOD :
153+ extensions = { " return_both_v4_and_v6" :
154+ getdns.EXTENSION_TRUE ,
155+ " dnssec_return_status" :
156+ getdns.EXTENSION_TRUE }
157+ results = ctx.address(name = sys.argv[1 ],
158+ extensions = extensions)
159+ if results.status == getdns.RESPSTATUS_GOOD :
156160 sys.stdout.write(" Addresses: " )
157- for addr in results[ " just_address_answers" ] :
161+ for addr in results. just_address_answers:
158162 print " {0} " .format(addr[" address_data" ])
159163 sys.stdout.write(" \n " )
160164
161- for result in results[ " replies_tree" ] :
165+ for result in results. replies_tree:
162166 if " dnssec_status" in result.keys():
163- print " {0} : dnssec_status: {1} " .format(result[" canonical_name" ],
167+ print " {0} : dnssec_status:
168+ {1 }" .format(result[" canonical_name" ],
164169 dnssec_message(result[" dnssec_status" ]))
165170
166- if results[ " status" ] == getdns.GETDNS_RESPSTATUS_NO_NAME :
171+ if results. status == getdns.RESPSTATUS_NO_NAME :
167172 print " {0} not found" .format(sys.argv[1 ])
168173
169174
170175 if __name__ == " __main__" :
171176 main()
172-
177+
173178
174179 Known issues
175180============
@@ -186,7 +191,7 @@ Contents:
186191
187192 functions
188193 response
189-
194+ exceptions
190195
191196
192197Indices and tables
0 commit comments