[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-06 Thread Leon Weber

Leon Weber added the comment:

I noticed an inconsistency between IPv4 and IPv6 in my temporary variable names 
when looking at the patch again after a few days. Here’s an updated patch. Not 
that it’s important, but I sleep better that way :)

As consensus seems to have settled on leaving out the trailing dot, I only 
updated the version without the dot.

--
Added file: http://bugs.python.org/file33940/ipaddress_reverse_names_v4.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20480
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-02 Thread Leon Weber

Leon Weber added the comment:

I’ve changed the wording in the documentation a bit and added an explanatory 
sentence, how about this?

I think this should make pretty clear what it does and does not, and also easy 
to find in the documentation when searching for “reverse”, “PTR” and “pointer” 
(which is what I can think of what one would be looking for).

(Not sure whether to add further patches in roundup or rietveld, but a quick 
google search reveals patches are periodically added to rietveld automatically, 
so I’ll just add it here. Please let me know if this is not correct :))

--
Added file: http://bugs.python.org/file33865/ipaddress_reverse_names_v3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20480
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-02 Thread Leon Weber

Leon Weber added the comment:

 As for what the host command does, it doesn't add any trailing dots
 here:

Oh, interesting. It does on Fedora 19 with version 9.9.3, but not on my Ubuntu 
installation with version 9.8.1. So it seems this was added between 9.8.1 and 
9.9.3.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20480
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-02 Thread Leon Weber

Leon Weber added the comment:

 According to apt-cache, the version I tried with is
 1:9.9.3.dfsg.P2-4ubuntu1

Ok, then it depends on something else apparently. It’s not so relevant anyway 
because even with the trailing dot, “host” is inconsistent between IPv4 and 
IPv6, and we should choose a consistent variant.

I’m still slightly in favour of having the trailing dot, because it is the 
correct representation of the DNS name. RFC1034 section 3.1 explicitly states 
that “Since a complete domain name ends with the root label, this leads to a 
printed form which ends in a dot.”. It goes on to explain that relative names 
(names not ending in a dot) “appear mostly at the user interface, where their 
interpretation varies from implementation to implementation” and that the most 
common interpretation is relative to the root zone.

So leaving the dot off is merely a convention, which is good enough for 
Wikipedia and RIPE documents; however I think in an API we should implement the 
more strict option. Also, I don’t see anything breaking with the dot, while 
without the dot, a user needs to take extra care when feeding the name to 
dnspython’s dns.resolver.query(), which would do undesired things without the 
trailing dot (append a search domain if there is one in /etc/resolv.conf).

Any other opinions?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20480
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20480] Add ipaddress property to get name of reverse DNS PTR record

2014-02-02 Thread Leon Weber

Leon Weber added the comment:

I can live without the trailing dot, although I’d find it “more correct” to 
have it.

I’ve attached an alternative patch that doesn’t return a trailing dot, it’s up 
to you guys to decide which one you prefer.

--
Added file: 
http://bugs.python.org/file33870/ipaddress_reverse_names_v3_alt.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20480
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20480] Add ipaddress property to get reverse DNS name

2014-02-01 Thread Leon Weber

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 rep...@bugs.python.org
http://bugs.python.org/issue20480
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20480] Add ipaddress property to get name of reverse DNS pointer

2014-02-01 Thread Leon Weber

Leon Weber added the comment:

Thanks for the feedback, I agree reverse_pointer is a better, less ambiguous 
name for the property. I’ve amended the patch to reflect this suggestion.

Regarding the trailing dot, I felt it more appropriate to have it that to leave 
it out, but I don’t have a strong opinion on this. It has to be there in the 
DNS query, but most tools will automatically add it to the query if it’s not 
specified. The host tool from bind-utils is undecided as well when printing 
the output, it includes the trailing dot when querying IPv4 addresses, but not 
for IPv6 addresses.

Including the trailing dot has the advantage that the output could be directly 
fed into other code that strictly requires it, like the dnspython module.

I’ll sign and submit the contributor’s agreement as soon as I’m within reach of 
a printer (likely within the next 24 hours).

--
Added file: http://bugs.python.org/file33852/ipaddress_reverse_names_v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20480
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20480] Add ipaddress property to get name of reverse DNS pointer

2014-02-01 Thread Leon Weber

Leon Weber added the comment:

Oh nice, then fewer trees have to die. I’ve now signed the contributor’s 
agreement.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20480
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com