Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Dynamic DNS Server WHM API PHP

Discussion in 'cPanel Developers' started by CanadaGuy, Sep 25, 2018.

  1. CanadaGuy

    CanadaGuy Active Member

    Joined:
    Sep 24, 2018
    Messages:
    33
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Ottawa
    cPanel Access Level:
    Root Administrator
    I'm trying to consolidate some services, and was looking to see what has been done with WHM and dynamic dns using API tokens. I found this, but it is user/password based:

    github.com/teampalmtree/WHMDDNS

    I found this as an example of the API token implementation for php:

    Guide to API Authentication - API Tokens - Developer Documentation - cPanel Documentation

    Has anyone done something already? Between the above two links I think I could hack together something for my own uses, but I thought I would ask the community.
     
    #1 CanadaGuy, Sep 25, 2018
    Last edited by a moderator: Sep 25, 2018
  2. CanadaGuy

    CanadaGuy Active Member

    Joined:
    Sep 24, 2018
    Messages:
    33
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Ottawa
    cPanel Access Level:
    Root Administrator
    So I took those two examples I posted and wrote a php script that is mostly compatible with the DynDNS "protocol". There isn't as much to it as I thought. I need to clean up and workout the authentication part still but if anyone is interested, I'd be happy to share.

    You need to create a WHM API token for it to work. You then configure a sub-domain to act as the update server where you drop the php script and .htaccess file. Then you configure your DDNS client to point at the server, use DynDNS protocol (if necessary) and go to town. It could still use some improvements to flexibility and robustness I'm sure.
     
    cPanelMichael likes this.
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @CanadaGuy,

    Feel free to share the script here, or perhaps create a GitHub repo for it and share the link. You may also find the following GitHub repo helpful:

    CpanelInc/cpanel-dynamicdns-tools

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. CanadaGuy

    CanadaGuy Active Member

    Joined:
    Sep 24, 2018
    Messages:
    33
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Ottawa
    cPanel Access Level:
    Root Administrator
    Thanks for providing that link. That is a well developed script it looks like, but in a different direction. I'll share mine when I get a little more done.
     
    cPanelMichael likes this.
  5. CanadaGuy

    CanadaGuy Active Member

    Joined:
    Sep 24, 2018
    Messages:
    33
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    Ottawa
    cPanel Access Level:
    Root Administrator
    Here is my code (but I'm not a coder in general). I still need to update the readme with how to use it.

    github.com/CanadaGuy/cpanel-ddns
     
    #5 CanadaGuy, Sep 30, 2018
    Last edited by a moderator: Oct 7, 2018
    cPanelMichael likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice