3 ==============================
5 ==============================
7 This example program performs DNSSEC validation of a DNS lookup.
13 from unbound import ub_ctx,RR_TYPE_A,RR_CLASS_IN
16 ctx.resolvconf("/etc/resolv.conf")
17 if (os.path.isfile("keys")):
18 ctx.add_ta_file("keys") #read public keys for DNSSEC verification
20 status, result = ctx.resolve("www.nic.cz", RR_TYPE_A, RR_CLASS_IN)
21 if status == 0 and result.havedata:
23 print "Result:", result.data.address_list
26 print "Result is secure"
28 print "Result is bogus"
30 print "Result is insecure"
32 More detailed informations can be seen in libUnbound DNSSEC tutorial `here`_.
34 .. _here: http://www.unbound.net/documentation/libunbound-tutorial-6.html