dnspython  1.16.0
About: dnspython is a DNS toolkit (for Python 2.x) that supports almost all record types.
  Fossies Dox: dnspython-1.16.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

dns.reversename Namespace Reference

Functions

def from_address (text)
 
def to_address (name)
 

Variables

 ipv4_reverse_domain = dns.name.from_text('in-addr.arpa.')
 
 ipv6_reverse_domain = dns.name.from_text('ip6.arpa.')
 

Function Documentation

◆ from_address()

def dns.reversename.from_address (   text)
Convert an IPv4 or IPv6 address in textual form into a Name object whose
value is the reverse-map domain name of the address.

*text*, a ``text``, is an IPv4 or IPv6 address in textual form
(e.g. '127.0.0.1', '::1')

Raises ``dns.exception.SyntaxError`` if the address is badly formed.

Returns a ``dns.name.Name``.

Definition at line 32 of file reversename.py.

References dns.name.from_text(), dns.ipv4.inet_aton(), dns.ipv6.inet_aton(), and dns.ipv6.is_mapped().

Referenced by dns.resolver._getnameinfo().

◆ to_address()

def dns.reversename.to_address (   name)
Convert a reverse map domain name into textual address form.

*name*, a ``dns.name.Name``, an IPv4 or IPv6 address in reverse-map name
form.

Raises ``dns.exception.SyntaxError`` if the name does not have a
reverse-map form.

Returns a ``text``.

Definition at line 63 of file reversename.py.

References dns.ipv4.inet_aton(), dns.ipv6.inet_aton(), dns.ipv4.inet_ntoa(), and dns.ipv6.inet_ntoa().

Variable Documentation

◆ ipv4_reverse_domain

dns.reversename.ipv4_reverse_domain = dns.name.from_text('in-addr.arpa.')

Definition at line 28 of file reversename.py.

◆ ipv6_reverse_domain

dns.reversename.ipv6_reverse_domain = dns.name.from_text('ip6.arpa.')

Definition at line 29 of file reversename.py.