summaryrefslogtreecommitdiff
path: root/doc/name-helpers.rst
blob: 3c91a73cb22071cc01d65b4eb7c419689f237bd8 (plain)
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
35
36
37
38
39
40
41
.. _name-helpers:

Name Helpers
------------

Sometimes you want to look up an address in the DNS instead of a name.
Dnspython provides a helper functions for converting between addresses
and their "reverse map" form in the DNS.

For example:

========= =========================================================================
Address   DNS Reverse Name
========= =========================================================================
127.0.0.1 1.0.0.127.in-addr.arpa.
::1       1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa.
========= =========================================================================

|

.. autofunction:: dns.reversename.from_address
.. autofunction:: dns.reversename.to_address

Dnspython also provides helpers for converting E.164 numbers (i.e.
telephone numbers) into the names used for them in the DNS.

For example:

================ ==================================
Number           DNS E.164 Name
================ ==================================
+1.650.555.1212  2.1.2.1.5.5.5.0.5.6.1.e164.arpa.
+44 20 7946 0123 3.2.1.0.6.4.9.7.0.2.4.4.e164.arpa.
================ ==================================

|

.. autofunction:: dns.e164.from_e164
.. autofunction:: dns.e164.to_e164