Home | History | Annotate | Line # | Download | only in examples
      1 #!/usr/bin/python
      2 # vim:fileencoding=utf-8
      3 #
      4 # IDN (Internationalized Domain Name) lookup support
      5 #
      6 import unbound
      7 
      8 ctx = unbound.ub_ctx()
      9 ctx.resolvconf("/etc/resolv.conf")
     10 
     11 status, result = ctx.resolve(u"www.hkyrky.cz", unbound.RR_TYPE_A, unbound.RR_CLASS_IN)
     12 if status == 0 and result.havedata:
     13     print "Result:"
     14     print "      raw data:", result.data
     15     for k in result.data.address_list:
     16         print "      address:%s" % k
     17 
     18