diff options
author | anonimal <anonimal@i2pmail.org> | 2017-06-28 21:07:24 +0000 |
---|---|---|
committer | anonimal <anonimal@i2pmail.org> | 2018-03-18 15:52:19 +0000 |
commit | 84c5a9ba481d7a33cc0fd0ca43867b61d127d907 (patch) | |
tree | f05d3d3f107da02005b4a61f0e5074c113a7165c /external/unbound/libunbound/python/examples | |
parent | Merge pull request #3416 (diff) | |
download | monero-84c5a9ba481d7a33cc0fd0ca43867b61d127d907.tar.xz |
Unbound: remove unbound from in-tree source
We'll instead use a git submodule to pull from our unbound repo.
Diffstat (limited to 'external/unbound/libunbound/python/examples')
9 files changed, 0 insertions, 469 deletions
diff --git a/external/unbound/libunbound/python/examples/async-lookup.py b/external/unbound/libunbound/python/examples/async-lookup.py deleted file mode 100644 index 936be3218..000000000 --- a/external/unbound/libunbound/python/examples/async-lookup.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/python -''' - async-lookup.py : This example shows how to use asynchronous lookups - - Authors: Zdenek Vasicek (vasicek AT fit.vutbr.cz) - Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) - - Copyright (c) 2008. All rights reserved. - - This software is open source. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -''' -from __future__ import print_function -import unbound -import time - -ctx = unbound.ub_ctx() -ctx.resolvconf("/etc/resolv.conf") - -def call_back(my_data,status,result): - print("Call_back:", sorted(my_data)) - if status == 0 and result.havedata: - print("Result:", sorted(result.data.address_list)) - my_data['done_flag'] = True - - -my_data = {'done_flag':False,'arbitrary':"object"} -status, async_id = ctx.resolve_async("www.nic.cz", my_data, call_back, unbound.RR_TYPE_A, unbound.RR_CLASS_IN) - -while (status == 0) and (not my_data['done_flag']): - status = ctx.process() - time.sleep(0.1) - -if (status != 0): - print("Resolve error:", unbound.ub_strerror(status)) diff --git a/external/unbound/libunbound/python/examples/dns-lookup.py b/external/unbound/libunbound/python/examples/dns-lookup.py deleted file mode 100644 index a175dfb0e..000000000 --- a/external/unbound/libunbound/python/examples/dns-lookup.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/python -''' - dns-lookup.py : This example shows how to resolve IP address - - Authors: Zdenek Vasicek (vasicek AT fit.vutbr.cz) - Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) - - Copyright (c) 2008. All rights reserved. - - This software is open source. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -''' -from __future__ import print_function -import unbound - -ctx = unbound.ub_ctx() -ctx.resolvconf("/etc/resolv.conf") - -status, result = ctx.resolve("www.nic.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result:", sorted(result.data.address_list)) -elif status != 0: - print("Error:", unbound.ub_strerror(status)) diff --git a/external/unbound/libunbound/python/examples/dnssec-valid.py b/external/unbound/libunbound/python/examples/dnssec-valid.py deleted file mode 100644 index c5517efc6..000000000 --- a/external/unbound/libunbound/python/examples/dnssec-valid.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/python -''' - dnssec-valid.py: DNSSEC validation - - Authors: Zdenek Vasicek (vasicek AT fit.vutbr.cz) - Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) - - Copyright (c) 2008. All rights reserved. - - This software is open source. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -''' -from __future__ import print_function -import os -from unbound import ub_ctx,RR_TYPE_A,RR_CLASS_IN - -ctx = ub_ctx() -ctx.resolvconf("/etc/resolv.conf") - -fw = open("dnssec-valid.txt","wb") -ctx.debugout(fw) -ctx.debuglevel(2) - -if os.path.isfile("keys"): - ctx.add_ta_file("keys") #read public keys for DNSSEC verification - -status, result = ctx.resolve("www.nic.cz", RR_TYPE_A, RR_CLASS_IN) -if status == 0 and result.havedata: - - print("Result:", sorted(result.data.address_list)) - - if result.secure: - print("Result is secure") - elif result.bogus: - print("Result is bogus") - else: - print("Result is insecure") - diff --git a/external/unbound/libunbound/python/examples/dnssec_test.py b/external/unbound/libunbound/python/examples/dnssec_test.py deleted file mode 100644 index 430e51a80..000000000 --- a/external/unbound/libunbound/python/examples/dnssec_test.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function -from unbound import ub_ctx, RR_TYPE_A, RR_TYPE_RRSIG, RR_TYPE_NSEC, RR_TYPE_NSEC3 -import ldns - -def dnssecParse(domain, rrType=RR_TYPE_A): - print("Resolving domain", domain) - s, r = resolver.resolve(domain) - print("status: %s, secure: %s, rcode: %s, havedata: %s, answer_len; %s" % (s, r.secure, r.rcode_str, r.havedata, r.answer_len)) - - s, pkt = ldns.ldns_wire2pkt(r.packet) - if s != 0: - raise RuntimeError("Error parsing DNS packet") - - rrsigs = pkt.rr_list_by_type(RR_TYPE_RRSIG, ldns.LDNS_SECTION_ANSWER) - print("RRSIGs from answer:", sorted(rrsigs)) - - rrsigs = pkt.rr_list_by_type(RR_TYPE_RRSIG, ldns.LDNS_SECTION_AUTHORITY) - print("RRSIGs from authority:", sorted(rrsigs)) - - nsecs = pkt.rr_list_by_type(RR_TYPE_NSEC, ldns.LDNS_SECTION_AUTHORITY) - print("NSECs:", sorted(nsecs)) - - nsec3s = pkt.rr_list_by_type(RR_TYPE_NSEC3, ldns.LDNS_SECTION_AUTHORITY) - print("NSEC3s:", sorted(nsec3s)) - - print("---") - - -resolver = ub_ctx() -resolver.add_ta(". IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5") - -dnssecParse("nic.cz") -dnssecParse("nonexistent-domain-blablabla.cz") -dnssecParse("nonexistent-domain-blablabla.root.cz") - diff --git a/external/unbound/libunbound/python/examples/example8-1.py b/external/unbound/libunbound/python/examples/example8-1.py deleted file mode 100644 index 723c4060e..000000000 --- a/external/unbound/libunbound/python/examples/example8-1.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/python -# vim:fileencoding=utf-8 -''' - example8-1.py: Example shows how to lookup for MX and NS records - - Authors: Zdenek Vasicek (vasicek AT fit.vutbr.cz) - Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) - - Copyright (c) 2008. All rights reserved. - - This software is open source. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -''' -from __future__ import print_function -import unbound - -ctx = unbound.ub_ctx() -ctx.resolvconf("/etc/resolv.conf") - -status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_MX, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result:") - print(" raw data:", result.data) - for k in sorted(result.data.mx_list): - print(" priority:%d address:%s" % k) - -status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result:") - print(" raw data:", result.data) - for k in sorted(result.data.address_list): - print(" address:%s" % k) - -status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_NS, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result:") - print(" raw data:", result.data) - for k in sorted(result.data.domain_list): - print(" host: %s" % k) - diff --git a/external/unbound/libunbound/python/examples/idn-lookup.py b/external/unbound/libunbound/python/examples/idn-lookup.py deleted file mode 100644 index f28315067..000000000 --- a/external/unbound/libunbound/python/examples/idn-lookup.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/python -# vim:fileencoding=utf-8 -''' - idn-lookup.py: IDN (Internationalized Domain Name) lookup support - - Authors: Zdenek Vasicek (vasicek AT fit.vutbr.cz) - Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) - - Copyright (c) 2008. All rights reserved. - - This software is open source. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -''' -from __future__ import print_function -import unbound -import locale - -ctx = unbound.ub_ctx() -ctx.set_option("module-config:","iterator") #We don't need validation -ctx.resolvconf("/etc/resolv.conf") - -#The unicode IDN string is automatically converted (if necessary) -status, result = ctx.resolve(u"www.háčkyčárky.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result:") - print(" raw data:", result.data) - for k in sorted(result.data.address_list): - print(" address:%s" % k) - -status, result = ctx.resolve(u"háčkyčárky.cz", unbound.RR_TYPE_MX, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result:") - print(" raw data:", result.data) - for k in sorted(result.data.mx_list_idn): - print(" priority:%d address:%s" % k) - -status, result = ctx.resolve(unbound.reverse('217.31.204.66')+'.in-addr.arpa', unbound.RR_TYPE_PTR, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result.data:", result.data) - for k in sorted(result.data.domain_list_idn): - print(" dname:%s" % k) diff --git a/external/unbound/libunbound/python/examples/mx-lookup.py b/external/unbound/libunbound/python/examples/mx-lookup.py deleted file mode 100644 index e9394b355..000000000 --- a/external/unbound/libunbound/python/examples/mx-lookup.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/python -# vim:fileencoding=utf-8 -''' - mx-lookup.py: Lookup for MX records - - Authors: Zdenek Vasicek (vasicek AT fit.vutbr.cz) - Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) - - Copyright (c) 2008. All rights reserved. - - This software is open source. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -''' -from __future__ import print_function -import unbound - -ctx = unbound.ub_ctx() -ctx.resolvconf("/etc/resolv.conf") - -status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_MX, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result:") - print(" raw data:", result.data) - for k in sorted(result.data.mx_list): - print(" priority:%d address:%s" % k) - -status, result = ctx.resolve("nic.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result:") - print(" raw data:", result.data) - for k in sorted(result.data.address_list): - print(" address:%s" % k) diff --git a/external/unbound/libunbound/python/examples/ns-lookup.py b/external/unbound/libunbound/python/examples/ns-lookup.py deleted file mode 100644 index 49f567283..000000000 --- a/external/unbound/libunbound/python/examples/ns-lookup.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/python -# vim:fileencoding=utf-8 -''' - ns-lookup.py: Example shows how to lookup for NS records - - Authors: Zdenek Vasicek (vasicek AT fit.vutbr.cz) - Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) - - Copyright (c) 2008. All rights reserved. - - This software is open source. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -''' -from __future__ import print_function -import unbound - -ctx = unbound.ub_ctx() -ctx.resolvconf("/etc/resolv.conf") - -status, result = ctx.resolve("vutbr.cz", unbound.RR_TYPE_NS, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result:") - print(" raw data:", result.data) - for k in sorted(result.data.domain_list): - print(" host: %s" % k) - diff --git a/external/unbound/libunbound/python/examples/reverse-lookup.py b/external/unbound/libunbound/python/examples/reverse-lookup.py deleted file mode 100644 index c9a13fea6..000000000 --- a/external/unbound/libunbound/python/examples/reverse-lookup.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python -''' - reverse-lookup.py: Example shows how to resolve reverse record - - Authors: Zdenek Vasicek (vasicek AT fit.vutbr.cz) - Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) - - Copyright (c) 2008. All rights reserved. - - This software is open source. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -''' -from __future__ import print_function -import unbound - -ctx = unbound.ub_ctx() -ctx.resolvconf("/etc/resolv.conf") - -status, result = ctx.resolve(unbound.reverse("74.125.43.147") + ".in-addr.arpa.", unbound.RR_TYPE_PTR, unbound.RR_CLASS_IN) -if status == 0 and result.havedata: - print("Result.data:", result.data, sorted(result.data.domain_list)) - |