SOLVED Using the new DDNS feature

ddaddy

Well-Known Member
Aug 19, 2015
60
11
58
UK
cPanel Access Level
Root Administrator
I am testing out the new DDND feature introduced in v92.
I have it setup in CPanel, but need clarification on how to call it to update the IP.

My DD-WRT router had a DDND updater built in. It insists that I enter a username and password, so I added the CPanel account details.
Viewing it's logs, it seems to send a GET request like this:
GET /cpanelwebcall/zvatjiaxfbfkio<redacted>ueyzpvv?home.<redacted>.com HTTP/1.0
Authorization: Basic ZGRhZGR<redacted>tMHRlY21h
Host: <redacted>.com
User-Agent: inadyn advanced/1.96-ADV [email protected]
You can see it connects to the host using the path supplied by the DDNS page in CPanel. It sends the user/pass as a basic auth header. It also insists on appending the DDNS host to the end as a query parameter.

I've read the DDNS instructions page, but are there any technical details on what the updater will be looking at?

With the above request I get this response:
Tue Dec 1 14:36:04 2020: W:INADYN: Response Code: 1
Tue Dec 1 14:36:04 2020: W:INADYN: Error validating DYNDNS svr answer. Check usr,pass,hostname! (HTTP/1.1 404 Not Found
Date: Tue, 01 Dec 2020 14:36:04 GMT
Server: Apache
Content-Length: 315
Connection: close
Content-Type: text/html; charset=iso-8859-1

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.

)
I already have DDNS working using a custom script, but thought i'd give this new feature a whirl.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,492
1,008
313
cPanel Access Level
Root Administrator
Hey there! I can't say that I'm familiar with this requiring a user or password. The only tools we have available on the cPanel side is the creation of the URL that would be provided to the service you're accessing. Since cPanel has no knowledge of the user and password you're entering on the router side, we may not be able to work properly with that specific device.

I did check the configuration guide here:


and it looks like that specific configuration is designed to login to a full DDNS service, and not the type that is provided with cPanel. Do you have an option to just not include the username and password?
 

ddaddy

Well-Known Member
Aug 19, 2015
60
11
58
UK
cPanel Access Level
Root Administrator
Ok, I’ll switch back to my existing setup for now.
If all that’s required is visiting the URL, then maybe ignoring both the auth header and any added params, it should then work with DD-WRT.
 
  • Like
Reactions: cPRex

spiral2

Member
Dec 16, 2020
6
0
1
Somewhere
cPanel Access Level
Website Owner
I am also trying to use this feature. But I don't know how to call the uri generated.
It generated the url in the url "https://<domainname>/cpanelwebcall/<code>.

How is this URL supposed to get called, some pointer at documentation would be nice.

I want to run a script on my linux system that call the above uri.

Thanks @cPRex
 

spiral2

Member
Dec 16, 2020
6
0
1
Somewhere
cPanel Access Level
Website Owner
Well I did that in Postman and in the browser. But it sends me a 400 or a 404 (depends on what I try):

This is from the ssl_log from the cpanel interface:
Code:
<ipaddress>- - [<date>] "GET /cpanelwebcall/<code> HTTP/1.1" 404 - "-" "PostmanRuntime/7.26.3"
The response I received in Postman without useful information in the response headers:

Code:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<p>Additionally, a 400 Bad Request
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
In the errors page from the cpanel interface I can't find anything related.

This is my config.

snippet.PNG

The version used is 92.0.5
 
Last edited:

alepaes

Member
Feb 28, 2011
8
0
51
Same problem here - 404 not found.

In fact, CPanel should not provide such a resource with this poor documentation.
 

spiral2

Member
Dec 16, 2020
6
0
1
Somewhere
cPanel Access Level
Website Owner
I followed this guide. Dynamic DNS | cPanel & WHM Documentation

Code:
1. Go to my hosting provider
2. Signin
3. Go to cPanel v.92.0.5 (theme paper_lantern)
4. Click on Dynamic DNS
5. Click on Create
6. Fill in the field `Dynamic DNS DOMAIN`
    a. subdomain name: home
    b. The domain dropdown is disabled because there's only one domain available
7. Click on Create
8. Green messages popup that it is created
9. Automatic redirect to the Dynamic DNS overview
10. Verify
    a. Domain is filled correctly
    b. IP Address is `None`
    c. URL is created in format `https://<domain>/cpanelwebcall/<code>`. (domain != subdomain)
    d. SSL Certificate is viewable
10. Click on the COPY button
11. Open Google Chrome Browser.
12. Press F12 for the Developer Console. Go to the Network Tab
13. Paste in the URI in the `Addressbar` of the browser
14. Press `Enter`
15. Verify the respone.
    a. Status code 404 is returned
    b. The response is:
        <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
        <html>
            <head>
                <title>404 Not Found</title>
            </head>
            <body>
                <h1>Not Found</h1>
                <p>The requested URL was not found on this server.</p>
                <p>Additionally, a 404 Not Found
        error was encountered while trying to use an ErrorDocument to handle the request.</p>
            </body>
        </html>

16. If we go back to step 10.b We won't see the IP-Address filled
 

ddaddy

Well-Known Member
Aug 19, 2015
60
11
58
UK
cPanel Access Level
Root Administrator
I just tested mine and it works fine. I created a new ddns domain. At this point, no A record was added to the dns. I copied the generated URL and pasted it into safari and hot go. It showed me my IP and now there was an A record with my ip address.
 
  • Like
Reactions: cPRex

alepaes

Member
Feb 28, 2011
8
0
51
@alepaes - if you can provide me details on where you are getting stuck I'm happy to help get the documentation updated or made more clear.
Hi cPRex,

The most common use of DDNS is with a user and password. This is an example of ddclient config:

use=web, web=checkip.dynu.com/, web-skip='IP Address' # Get ip from server.
server=api.dynu.com # IP update server.
protocol=dyndns2
login=[email protected] # Your username.
password=abc # Password or MD5/SHA256 of password.
myrouter.ddnsgeek.com # List one or more hostnames one on each line.

In this case, ddclient go to http://checkip.dynu.com to collect your actual ip and send this via dyndns2 protocol to api.dynu.com requesting a update to the A record of myrouter.ddnsgeek.com.

Ok if Cpanel decide to do this in a simple way, only visiting the generated URL (wich is good to use with CURL, i.e.), but this must be included in documentation.
Anyway, in my case (like @spiral2 and different from @ddady), the URL generated (I tested in some domains) every show me an error 404:

1608204251966.png

Apparently, Cpanel does not capture /cpanelwebcall and try to search a path/file in my public_html.

Thanks for help.
 

alepaes

Member
Feb 28, 2011
8
0
51
@alepaes - thanks for the detailed reply. Would you happen to be doing this work on a CloudLinux system? If so, can you check out our article here to see if that helps with your situation?

My server is CentOS but the workaround below solves the problem.

Thanks cPRex !

1608225403866.png