Update dns-01 via cpanel with a hook

Hi All, long time lurker ( use LE on a few sites successfully ) but haven’t signed up until today as I’ve always been able to find my answer by searching or testing. The issue I have is we have an internal web app, hosted at lots of our customer sites, some of our customers don’t have domains or don’t have control access to them.

Our solution is to use one of our domains so customer.ourdomain.tld and point their internal DNS at this and use certbot to automate this.

I can do this and get it to work fine manually, my issue is, with 30-40 sites now, and probably more in the future I’d like to automate this, hooks appear to be what I need to use, but all our domains are currently on a couple of different cPanel hosts

I’ve searched and searched for a hook that’s already been written, this web app can’t be external so I would like to use DNS-01 to update. Does anyone have a solution using the cPanel API ? I can probably write something eventually if it comes to it, but it looks like a complete mess on the cPanel side.

I have full access to the cPanel install ( running CentOS 6.9 and version 66.0.26 of cpanel )

The local boxes are running Apache and Centos6.9, as I say the local side is fine, I’d just like to automate the updates with the dns option.

Any more info I need to supply let me know, I’ve tried to supply as much as I can.

Thanks in advance,


Edit : Links I’ve found

https://github.com/a1291762/acme.sh with reference to hooks etc

1 Like

I have been looking at doing the same thing based on Nailpang’s acme.sh. A cPanel user (cPanelNick) a while back provided a handy little dynamic dns updater on their forums https://forums.cpanel.net/threads/can-cpanel-update-dynamic-ip-information-to-dns-records.261951/. The only issue is I’m not certain of the licensing terms of their code so it may need to be re-implemented to meet with the acme.sh license terms.

It would take a bit of effort to adjust their that logic to update and then remove the TXT record, but I believe just about everything is there that is needed. It just needs stitched together. This is a bit of a pet project for me so I may work on just that, but not sure how long it will take.

Check out this: https://github.com/smythe811/acme.sh/blob/patch-1/dnsapi/dns_cpanel.sh

It may work work for what you are attempting to accomplish.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.