0

Why does the usage of

from unbound import ub_ctx,RR_TYPE_A,RR_CLASS_IN

causes

ImportError: No module named unbound

import os
from unbound import ub_ctx,RR_TYPE_A,RR_CLASS_IN

ctx = ub_ctx()
ctx.resolvconf("/etc/resolv.conf")
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:", result.data.address_list

    if result.secure:
        print "Result is secure"
    elif result.bogus:
        print "Result is bogus"
    else:
        print "Result is insecure"
clemens
  • 16,716
  • 11
  • 50
  • 65
Arun
  • 33
  • 3
  • 1
    Seems Python cannot find that module. Is in in your PYTHONPATH? Or in your sitepackages directory? – Jacques de Hooge Jun 25 '15 at 18:37
  • 1
    Did you manually install the module `unbound`? It doesn't seem to come with Python normally. If you didn't install it, go here: https://www.unbound.net/documentation/pythonmod/install.html – DivideByZero Jun 25 '15 at 18:50
  • what operating system are you using and are you trying deploying into ubuntu server ? – Praneeth Jun 25 '15 at 19:52
  • Possible duplicate of [Python error "ImportError: No module named"](https://stackoverflow.com/questions/338768/python-error-importerror-no-module-named) – tripleee Jan 10 '18 at 06:55

0 Answers0