Jump to content

Auto add DNS Zone to WHM (auto park domain)


hostb

Recommended Posts

Hi

I'm moving to WHMCS from my old system and very excited about it. I have a number of things to sort out. One of them is below.

On my old system I added a DNS zone to WHM for all domains that were purchased without hosting.

This is for two reasons.

1) Domains get a default parking page.

2) Irish domains (.ie) must resolve to a valid nameserver for registration to go through.

 

I used the below code (WHM PROVIDED API ) in an after function hook on my old system.

 

Where can I stick this code in WHMCS. Or does WHMCS provide a better solution?

 

The first three lines of code are specific to my old billing system. I also need a WHMCS equivalent for the variables used.

 

 

//Determine If The Domain Has Hosting Attached? 
//If not add a DNS zone to WHM. 

$hashosting = sqlsingle("SELECT * FROM hostinglist WHERE domain='$cSld.$cTld' and ownerid='$ownerid'","id");

if($hashosting ==0)
{

$ip = "xxx.xxx.xxx.xxx";
$root_pass = "password";
$domain = $cSld.".".$cTld;

$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
//$xmlapi->set_http_client('curl');
$xmlapi->set_port(2086);
$xmlapi->set_debug(1);
$result=$xmlapi->adddns($domain,$ip);
}


?>

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 1 month later...
  • 3 months later...
  • 4 months later...

I'll bet the optimal way to go is to have one package (Named _ParkedDomains or something), and when a customer parks a domain, whmcs uses an api to add the domain as a parking on this account.

Then some sort of automation to remove domains that are cancelled or ordered with hosting.

 

Do you mind sharing your hook? I'll bet there is more people here that may be can develop it further :-)

Link to comment
Share on other sites

I make it in this way:

 

Client A orders example1.com, example2.com and example3.com domains with no hosting. As soon as he pays i "secretly" add 3 fake-hosting plans on Plesk or cPanel one for each domain (basically these fake-hosting plans are DNS services) then i auto-register domain and, parallely, i auto-setup the 3 DNS plans on my Plesk/cPanel servers. I can also decide where all these DNS plans should go by default (e.g. today i send them all on 123.123.123.1 server but tomorrow i can also assign 123.123.123.2 server for this role).

 

Now on my order and invoice i have the following set of items:

 

myway.jpg

 

Domains and their relative DNS plans are synced so it means that DNS will always follow the status of his related domain. Domain active -> DNS active, domain expired -> DNS suspended, domain cancelled -> DNS terminated (deleted from Plesk/cPanel). I also hide from product list and invoice all these DNS plans so customers can only see their domains with nothing "attached".

 

Is it what you were looking for?

Link to comment
Share on other sites

  • 1 year later...

Did you try may use the services of registrars who offer so-called services like trustee service and local presence. You can register through them, even the most entrenched domain restrictions. So you don’t have then to worry about such things as parking DNS in particular Zone WHM. If you are looking for such companies that search for them in google for the phrases: local proxy and trustee.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated