[issue20480] Add ipaddress property to get name of reverse DNS PTR record
Roundup Robot added the comment: New changeset 5992d2c9522c by Eric V. Smith in branch 'default': Issue #20480: Add ipaddress.reverse_pointer. Patch by Leon Weber. http://hg.python.org/cpython/rev/5992d2c9522c -- nosy: +python-dev ___ 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
Changes by Eric V. Smith e...@trueblade.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ 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
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
Eric V. Smith added the comment: Looks good to me. Once 3.5 is open for new features, I'll commit this. (But feel free to ping me if you think it's lingering!) Thanks! -- assignee: - eric.smith ___ 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
Eric V. Smith added the comment: I'd prefer to leave the trailing dots. It's the technically correct thing to do. And as they say, technically correct is the best kind of correct! -- title: Add ipaddress property to get name of reverse DNS pointer - Add ipaddress property to get name of reverse DNS PTR record ___ 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
Eric V. Smith added the comment: The patch looks good to me, save for a versionadded tag in the docs. I've mentioned it on Rietveld. Not to get in to bikeshedding on the name, but I'd prefer something with PTR in the name. I'm an old-timer, and think of these as PTR lookups (because they are!). If I were looking for it, that's what I'd search for. And if not in the property name, then at least the documentation should mention it. -- ___ 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
Eric V. Smith added the comment: Or, now that I think about it some more, maybe leave the name as reverse_pointer and just mention PTR records in the documentation. -- ___ 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
Antoine Pitrou added the comment: I'd prefer to leave the trailing dots. It's the technically correct thing to do. It depends what we're talking about. Hostnames (in the general sense) don't carry a trailing dot except in DNS queries. So I'd argue the trailing dot is more part of the DNS protocol than of the hostname itself. As for what the host command does, it doesn't add any trailing dots here: $ host 127.0.0.1 1.0.0.127.in-addr.arpa domain name pointer XXX. $ host ::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 domain name pointer XXX. (this is bind9-host from Ubuntu) The Wikipedia page doesn't use trailing dots: http://en.wikipedia.org/wiki/Reverse_DNS_lookup Neither do the examples from the RIPE itself: http://www.ripe.net/data-tools/dns/reverse-dns/how-to-set-up-reverse-delegation -- ___ 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
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
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
Antoine Pitrou added the comment: 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. According to apt-cache, the version I tried with is 1:9.9.3.dfsg.P2-4ubuntu1 -- ___ 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
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
Antoine Pitrou added the comment: Well that convention is also used in existing APIs: socket.gethostbyaddr(8.8.8.8) ('google-public-dns-a.google.com', [], ['8.8.8.8']) (note that this merely reflects a POSIX API) -- ___ 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
Eric V. Smith added the comment: I concede the point on the trailing dot. The reason we used to always use it is that it prevented the local resolver from first trying to append the host's default domain name (as, for example, defined in /etc/resolv.conf as search). I have no idea if resolvers still do that. Some quick research shows that that's probably not their behavior any more, at least if the domain name contains at least one dot. -- ___ 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
Eric V. Smith added the comment: The documentation change looks good to me. -- ___ 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
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 name of reverse DNS PTR record
Nick Coghlan added the comment: From a principle of least surprise point of view, non-specialists would likely be puzzled by a trailing dot and wonder why it was there. By contrast, specialists that know the trailing dot is technically *supposed* to be there are already going to be accustomed to seeing it left out (because it is already left out in so many other contexts). So I'm +1 for leaving out the trailing dot, as that likely won't surprise *any* users. -- ___ 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