certbot-dns-cpanel
certbot-dns-cpanel copied to clipboard
Fix for the subdomain issue
When an account has a domain and a subdomain underneath it, Cpanel API returns them as separate zones (e. g. test.example.com and example.com). However, it will only let you create an _acme-challenge.test.example.com record via adding _acme-challenge.test to the example.com domain - trying to add _acme-challenge to the test.example.com errors out.
This PR changes the "find the zone for this domain" logic to look for the topmost (shortest) name.
I change the code according to your PR but got an issue when the TLD is like .or.jp etc..
Thanks for letting me know. What would you like me to do?