[issue20480] Add ipaddress property to get reverse DNS name

Leon Weber report at bugs.python.org
Sun Feb 2 02:22:28 CET 2014


New submission from Leon Weber:

I was missing a method to compute the reverse DNS name for an IP address, and I felt this is something that would belong in the ipaddress module; so here’s a patch for the ipaddress module adding a reverse_name property to IPv?Address.

This is an example:

>>> ipaddress.ip_address("127.0.0.1").reverse_name
'1.0.0.127.in-addr.arpa.'
>>> ipaddress.ip_address("2001:db8::1").reverse_name
'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.'

Would this be an acceptable feature for inclusion in the ipaddress module?

----------
components: Library (Lib)
files: ipaddress_reverse_names.patch
keywords: patch
messages: 209933
nosy: leonn, ncoghlan, pmoody
priority: normal
severity: normal
status: open
title: Add ipaddress property to get reverse DNS name
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file33851/ipaddress_reverse_names.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20480>
_______________________________________


More information about the Python-bugs-list mailing list