Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    1

    Default WHM API and Subdomains Question

    Hello cPanelers. I have reseller rights on my webhost, which gives me access to WHM. I've written a script in Perl that uses the WHM API to make new accounts, and this seems to work correctly. However, I'm having trouble figuring out how to do what I want to do, and so I'm hoping someone can offer some advice. Here is what I'd like to do:

    When someone registers at my site, I want to automatically create theirname.mydomain.com as a cpanel account. (I can do this now.) Then, perhaps immediately, or perhaps at a later date, I want to also let the user register a domain name through my eNom reseller account. At that time I'd like the domain name to become their site, and the original theirname.mydomain.com to point to the domain name. How do I do this through the API? Does parking a domain on their theirname.mydomain.com do this, or will that cause the parked domain to redirect traffic to the subdomain? I want their URL to be theirdomain.com once they've registered it.

    I can make a new account with the domain 'theirname.mydomain.com' and this works, but then how do I later give it it's own domain name through the API? Do I need to make a new account with the new domain name? How do I make a subdomain of my account and point it to their new domain? DNS zones?

    Any help would be greatly appreciated. I'm an experience Perl programmer, but I'm new to cPanel and WHM hosting.

    Thanks!

    -Andrew

  2. #2
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    I think parking a domain is sufficient, but I'm not sure there's an API hook for doing that.

    Parking a domain causes references to the domain www.theirdomain.com to be forwarded transparently to the original theirname.mydomain.com. However, theirname.mydomain.com will remain in the email addresses (perhaps as the default).

    The most thorough solution might be to recreate the account under the correct domain name.

    Regardless, the only way to script domain name parking is to simulate a post to the cpanel domain name parking page, and this is relatively easy -- there's code around that does it. It's not sufficient to modify the DNS zones as each account also has a httpd.conf entry which must be updated.

Similar Threads & Tags
Similar threads

  1. WHM XML API Question
    By sirbrent in forum cPanel Developers
    Replies: 1
    Last Post: 01-03-2011, 07:23 PM
  2. Wildcard Subdomains via API
    By GeekPatrolMille in forum cPanel Developers
    Replies: 1
    Last Post: 10-13-2009, 09:29 PM
  3. creating subdomains... cPanel API?
    By bcamp1973 in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 04-09-2007, 09:52 AM
  4. WHM Api question
    By Grooby in forum New User Questions
    Replies: 3
    Last Post: 08-12-2005, 12:37 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube