]>
git.saurik.com Git - apple/network_cmds.git/blob - unbound/libunbound/python/doc/examples/example8-1.py
79060167d83c35a47ab9b2566f2706e578470c44
2 # vim:fileencoding=utf-8
4 # Lookup for MX and NS records
9 ctx
.resolvconf("/etc/resolv.conf")
11 status
, result
= ctx
.resolve("nic.cz", unbound
.RR_TYPE_MX
, unbound
.RR_CLASS_IN
)
12 if status
== 0 and result
.havedata
:
14 print " raw data:", result
.data
15 for k
in result
.data
.mx_list
:
16 print " priority:%d address:%s" % k
18 status
, result
= ctx
.resolve("nic.cz", unbound
.RR_TYPE_A
, unbound
.RR_CLASS_IN
)
19 if status
== 0 and result
.havedata
:
21 print " raw data:", result
.data
22 for k
in result
.data
.address_list
:
23 print " address:%s" % k
25 status
, result
= ctx
.resolve("nic.cz", unbound
.RR_TYPE_NS
, unbound
.RR_CLASS_IN
)
26 if status
== 0 and result
.havedata
:
28 print " raw data:", result
.data
29 for k
in result
.data
.domain_list
: