Repository navigation
chg: [rdap] look hostnames up at their registered domain - #937
Merged
Merged
Conversation
Registries only hold registered domains, so asking rdap.org for a hostname, a subdomain or the host of a URL returned no record. The module now finds the registered domain with the ICANN section of the Public Suffix List and asks for it once; a public suffix is asked as given. The private section is skipped on purpose: duckdns.org is registered under .org, and its registry answers for duckdns.org, not foo.duckdns.org. The whois object's domain is the lowercased name that was asked, not RDAP's ldhName, and a comment says when it is the registered domain of the input host. The host is not added as a second domain, so the record does not read as the subdomain's own registration. A 404 or 400 on a domain lookup is reported as no record found, naming both names when they differ. Input is trimmed, lowercased and stripped of a trailing dot. IP lookups are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Member
|
Good one! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Registries only hold registered domains, so asking rdap.org for a hostname, a subdomain or the host of a URL returned no record. The module now finds the registered domain with the ICANN section of the Public Suffix List and asks for it once; a public suffix is asked as given. The private section is skipped on purpose: duckdns.org is registered under .org, and its registry answers for duckdns.org, not foo.duckdns.org.
The whois object's domain is the lowercased name that was asked, not RDAP's ldhName, and a comment says when it is the registered domain of the input host. The host is not added as a second domain, so the record does not read as the subdomain's own registration. A 404 or 400 on a domain lookup is reported as no record found, naming both names when they differ. Input is trimmed, lowercased and stripped of a trailing dot. IP lookups are unchanged.
Changes
Testing