example8.rst revision 238106
1299529Smm.. _example_mxlookup:
2299529Smm
3302001Smm=================================================
4299529SmmLookup for MX and NS records
5299529Smm=================================================
6299529Smm
7299529SmmThe pyUnbound extension provides functions which are able to encode RAW RDATA produces by unbound resolver (see :class:`unbound.ub_data`).
8299529Smm
9299529Smm..	literalinclude:: example8-1.py
10299529Smm	:language: python
11299529Smm
12299529SmmPrevious example produces following output::
13299529Smm
14299529Smm	Result:
15299529Smm		raw data: 00 0F 05 6D 61 69 6C 34 03 6E 69 63 02 63 7A 00;00 14 02 6D 78 05 63 7A 6E 69 63 03 6F 72 67 00;00 0A 04 6D 61 69 6C 03 6E 69 63 02 63 7A 00
16299529Smm		priority:15 address: mail4.nic.cz.
17299529Smm		priority:20 address: mx.cznic.org.
18299529Smm		priority:10 address: mail.nic.cz.
19299529Smm
20299529Smm	Result:
21302001Smm		raw data: D9 1F CD 32
22302001Smm		address: 217.31.205.50
23302001Smm
24302001Smm	Result:
25302001Smm		raw data: 01 61 02 6E 73 03 6E 69 63 02 63 7A 00;01 65 02 6E 73 03 6E 69 63 02 63 7A 00;01 63 02 6E 73 03 6E 69 63 02 63 7A 00
26302001Smm		host: a.ns.nic.cz.
27302001Smm		host: e.ns.nic.cz.
28302001Smm		host: c.ns.nic.cz.
29302001Smm