example8.rst revision 1.1.1.2
1.. _example_mxlookup:
2
3Lookup for MX and NS records
4============================
5
6The pyUnbound extension provides functions which are able to encode RAW RDATA
7produces by unbound resolver (see :class:`unbound.ub_data`).
8
9Source code
10-----------
11
12.. literalinclude:: example8-1.py
13    :language: python
14
15Output
16------
17
18The previous example produces the following output::
19
20    Result:
21        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
22        priority:15 address: mail4.nic.cz.
23        priority:20 address: mx.cznic.org.
24        priority:10 address: mail.nic.cz.
25
26    Result:
27        raw data: D9 1F CD 32
28        address: 217.31.205.50
29
30    Result:
31        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
32        host: a.ns.nic.cz.
33        host: e.ns.nic.cz.
34        host: c.ns.nic.cz.
35