File: example8.rst

package info (click to toggle)
unbound 1.24.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,436 kB
  • sloc: ansic: 138,476; sh: 6,860; yacc: 4,259; python: 1,950; makefile: 1,881; awk: 162; perl: 158; xml: 36
file content (34 lines) | stat: -rw-r--r-- 975 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.. _example_mxlookup:

Lookup for MX and NS records
============================

The pyUnbound extension provides functions which are able to encode RAW RDATA
produces by unbound resolver (see :class:`unbound.ub_data`).

Source code
-----------

.. literalinclude:: example8-1.py
    :language: python

Output
------

The previous example produces the following output::

    Result:
        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
        priority:15 address: mail4.nic.cz.
        priority:20 address: mx.cznic.org.
        priority:10 address: mail.nic.cz.

    Result:
        raw data: D9 1F CD 32
        address: 217.31.205.50

    Result:
        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
        host: a.ns.nic.cz.
        host: e.ns.nic.cz.
        host: c.ns.nic.cz.