kctan Posted April 1, 2012 Share Posted April 1, 2012 Hi, Recently I have registered a new private nameserver and now going to change all my clients' domain nameservers to the new one. Instead of logging in to change one by one, is there anyway in whmcs I can change all my client's nameserver in one go? I appreciate any help. Thank you. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted April 1, 2012 Share Posted April 1, 2012 Replace the admin ID with your WHMCS admin id, the name servers with your new name servers, and the registrar with whatever registrar you're using.. You'll probably want to glance at tbldomains to see what your registrar puts in the "registrar" field. For example, if you're using eNom, you would put "enom" in there. I make no warranties that this will actually work, as it hasnt been tested. <?php include("dbconnect.php"); include("includes/functions.php"); $adminid = '[b]1[/b]'; $d = select_query('tbldomains', 'id, domain', array('status'=>'Active', 'registrar'=>'[b]YOURREGISTRAR[/b]')); $postfields = array(); while ($res = mysql_fetch_assoc($d)) { $postfields['domainid'] = $res['id']; $postfields['ns1'] = '[b]ns1.yourdomain.com[/b]'; $postfields['ns2'] = '[b]ns2.yourdomain.com[/b]'; $resp = localApi('domainupdatenameservers', $postfields, $adminid); if ($resp['result'] == 'success') { echo $res['domain'].' has been successfully updated'. PHP_EOL; } else { echo 'Error updating '.$res['domain.': '.$resp['error']. PHP_EOL; } } ?> 0 Quote Link to comment Share on other sites More sharing options...
kctan Posted April 2, 2012 Author Share Posted April 2, 2012 Wow... thank you, Frank. So I guess there is no way to do this in the interface... 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted April 2, 2012 Share Posted April 2, 2012 and now going to change all my clients' domain nameservers to the new one Are you going to check they were using your nameservers before breaking the domain ? 0 Quote Link to comment Share on other sites More sharing options...
kctan Posted April 2, 2012 Author Share Posted April 2, 2012 Are you going to check they were using your nameservers before breaking the domain ? Hi, yes, I need to check the nameserver before I change them. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.