Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(170776)

Unified Diff: Doc/library/ipaddress.rst

Issue 20480: Add ipaddress property to get reverse DNS name
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/ipaddress.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
index 7c62750..83f1515 100644
--- a/Doc/library/ipaddress.rst
+++ b/Doc/library/ipaddress.rst
@@ -153,6 +153,20 @@ write code that handles both IP versions correctly.
the appropriate length (most significant octet first). This is 4 bytes
for IPv4 and 16 bytes for IPv6.
+ .. attribute:: reverse_pointer
+
+ The name of the reverse DNS PTR record for the IP address, e.g.::
+
+ >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
+ '1.0.0.127.in-addr.arpa'
+ >>> ipaddress.ip_address("2001:db8::1").reverse_pointer
+ '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'
+
+ This is the name that could be used for performing a PTR lookup, not the
+ resolved hostname itself.
+
+ .. versionadded:: 3.5
+
.. attribute:: is_multicast
``True`` if the address is reserved for multicast use. See
@@ -226,6 +240,7 @@ write code that handles both IP versions correctly.
groups consisting entirely of zeroes included.
.. attribute:: packed
+ .. attribute:: reverse_pointer
.. attribute:: version
.. attribute:: max_prefixlen
.. attribute:: is_multicast
« no previous file with comments | « no previous file | Lib/ipaddress.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+