-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle public suffixes that contain dots correctly #3
Comments
May I recommend the tldextract library for this task. It is also capable of using custom public suffix lists, should mozilla's list not meet your requirements. |
@elliotwutingfeng This seems like a great idea, especially given that those lists can get pretty big, and the library you suggested uses caching. The concern I have is that if we get this wrong, we might wipe the user's entire DNS entries with the My suggestion would be to
As mentionned in my above comment, this should really be an issue where the organisation sponsoring the TLD dropped support for new registrations under that suffix (such as domain.[province code].ca) but existing registrations were grandfathered in. Very few users would be affected. I'll be in Ottawa tomorrow so I will likely try this on Monday evening. Thanks for pointing me in the right direction! |
I'd like to add that I don't own any grandfathered domains of the form sorry-from-canada.qc.ca and that even if I did, I would be prohibited by the grandfathering rules from transferring it to Namecheap. Therefore we'd likely need a British volunteer with both god-save-the-king.uk and god-save-the-king.co.uk to test the fix. I might be wrong, but I don't think I'm allowed to register a .co.uk as a citizen of Canada. |
Right now the top-level domain and second-level domain are derived by splitting off the substring that follows the last dot.
For example, if the environment variable
CERTBOT_DOMAIN=my.blog.example.com
, the script will correctly identify:But for something like
eggs-with-spam.co.uk
, the script would wrongly identify:The correct behaviour would be:
Unfortunately this would require either an API from Namecheap that can identify which part of your registered domain is the SLD and which is the TLD, which is not a trivial task. One could make an HTTP GET request to
namecheap.domains.getTldList
, but that would fail to identify TLDs that are no longer registered but where existing registrations are grandfathered in (for example, domain.[province code].ca). If you suspect your domain's public suffix has a dot in it (a good starting point is the Public Suffix List), do not use this script unless you want to mess up every single one of your DNS records.I'm currently working on a solution that handles those cases gracefully.
The text was updated successfully, but these errors were encountered: