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.

Change A record in WHM upon account creation

Discussion in 'cPanel Developers' started by Todesengel, Jul 15, 2014.

  1. Todesengel

    Todesengel Registered

    Joined:
    Jul 15, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hey guys,

    Is it possible to set a custom A record on a zone file during account creation in WHM? I will be trying to use WHMCS to pass in a user field to WHM, to create a custom A record during sign-up so the user doesen't have to go into the DNS Zone editor afterwards.

    Thanks,
    JP
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
  3. Todesengel

    Todesengel Registered

    Joined:
    Jul 15, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    This leads me to another question, can you assign different zones to different packages?
     
  4. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    Unfortunately, cPanel doesn't support zone templates on a per-user or per-package basis right now. I found thread discussing a similar topic:

    http://forums.cpanel.net/f145/adding-custom-user-dns-zone-templates-233992.html

    However, I do not see that anyone has actually submitted a feature request for this at cPanel Feature Requests.

    As a sloppy and slightly embarrassing workaround, you can probably insert the changes into the zone file after account creation by using the postwwwacct script hook:

    https://documentation.cpanel.net/display/SDK/Script+Hooks

    If you give a little more detail I might be able to assist. Ie, does the record added depend on the package itself, to where a user on a specific package should always have a certain record?
     
  5. Todesengel

    Todesengel Registered

    Joined:
    Jul 15, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Well, I am trying to create a DNS only package. And I would like to give the client the ability to specify certain records during registration.

    I want to limit what they can modify in the DNS editor, so I was going to use my own control panel and only display A and CNAME records while limiting CPANEL access for the end user. I got this part working, I just don't know how to let them specify what A and CNAME records they want during registration.
     
  6. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    817
    Likes Received:
    22
    Trophy Points:
    18
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    When the user signs up, I suppose you could have something where they specify the DNS records they want, then have the script hook pick that data up and create the records after the account is created. Alternatively, you could have your registration system create the records after the account is set up using the API:

    https://documentation.cpanel.net/display/SDK/WHM+API+1+-+editzonerecord
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Note that beyond the custom script, you may want to submit a feature request for this via:

    Submit A Feature Request

    Thank you.
     
Loading...

Share This Page