The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changing DNS records from PHP

Discussion in 'cPanel Developers' started by simonpearce, Sep 10, 2009.

  1. simonpearce

    simonpearce Well-Known Member

    Joined:
    Jun 20, 2003
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    We need to be able to add/remove DNS records from zones in a cluster from a PHP script. For example:

    remove:

    domain.co.uk. 14400 IN MX 0 domain.co.uk.

    and add:

    domain.co.uk. 14400 IN MX 10 mta001.externalmx.com.
    domain.co.uk. 14400 IN MX 10 mta002.externalmx.com.
    domain.co.uk. 14400 IN MX 10 mta003.externalmx.com.
    domain.co.uk. 14400 IN MX 10 mta004.externalmx.com.

    Is this possible and how might we go about it?!

    Cheers

    Simon
     
  2. MattCurry

    MattCurry Well-Known Member

    Joined:
    Aug 18, 2009
    Messages:
    275
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Houston, Tx
    Changing DNS Records from PHP Script

    Hello,

    I do understand what you are trying to do, unfortunately it would not be something we support or recommend. There are many things in this scenario that could cause problems. Not to say that it will not work, it is just not something we would be able to directly support.

    Thank you,
    Matthew Curry
     
  3. simonpearce

    simonpearce Well-Known Member

    Joined:
    Jun 20, 2003
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Hi Matthew,

    I understand what you're saying but we were planning to use your new DNS functions at XML and JSON APIs

    We'll see how they go when they're launched.
     
  4. bvierra

    bvierra Well-Known Member

    Joined:
    Jul 28, 2006
    Messages:
    55
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    Southern California
    As long as you are using 11.25 these will work fine.
     
  5. benivolent

    benivolent Registered

    Joined:
    Oct 3, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    benivolent

    Nice post.I think it will work out but i will make it out and reply u.Let me try out this code.
     
  6. rggeeks

    rggeeks Registered

    Joined:
    Oct 6, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    hi

    sorry i cant understand this, whether your are trying to say website domain?

    Geeks
     
  7. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Another feature to mention in 11.25 is API2 calls for DNS editting, we should have these documented in the near future.

    This will allow for DNS records to be securely edited as the user.

    If this is something that will be done with root privileges.. then the XML-API calls should work fine.
     
Loading...

Share This Page