Add Cpanel support for Dynamic DNS Clients
Cpanel offers an API for updating DNS records.
Hence, Cpanel could now be added to the already extensive list of dynamic DNS service types.
So can you please add Cpanel support to you list of dynamic DNS service types
#1 Updated by Jocelyn Viau 4 months ago
The "Custom" service type works just fine for updating a CPanel Dynamic DNS record.
CPanel will use the IP address of the calling client as the new IP address for the associated record. So the new IP address does not actually need to be provided anywhere in the URL or body of the message but the update request must come from the interface having the IP address that your wish to update (usually the WAN interface).
No Username or Password need to be provided (the URL is called anonymously).
The Update URL will be something like https://cpanel.example.com/cpanelwebcall/fghkdfjslfhsljkdffghsjldkfsqlkdwk
But there is a catch, CPanel may put a wrong hostname in the URL it provides in the Dynamic DNS entry list. The hostname in the Update URL must be the same one you use to connect to your CPanel. In my case, the URL shown in CPanel for this DDNS entry was something like https://example.com//cpanelwebcall/fghkdfjslfhsljkdffghsjldkfsqlkdwk (notice the hostname is only my domain name). This URL gave me a 404 error. By changing the hostname in the URL for the one I use for accessing my CPanel, it worked.
You may use a simple web browser to check if you have a correct URL. If the Update URL is good, you will get a response that looks like "ipv4: xxx.xxx.xxx.xxx" (where xxx.xxx.xxx.xxx is your dynamic IP address). If the Update URL is wrong, you will typically get a 400 or 404 error.
Result Match will be "ipv4: IP"
I don't think that anything should be added to pfSense for supporting CPanel DDNS. However, the documentation on the CPanel side is lacking a lot: there is no explanation about the expected URL, the way the dynamic IP address is obtained nor the response format.
Hope this helps.
#2 Updated by Jocelyn Viau 4 months ago
You may also get a 500 error from CPanel if you try to update a dynamic DNS record when there is already a static DNS record (CNAME, A, etc.) for the same name. CPanel will no restrict you from creating a DDNS entry for an existing name, you will only get an error if your try to update it with the webservice.