Jump to content

Change all my clients' domain nameservers in one go


kctan

Recommended Posts

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.

Link to comment
Share on other sites

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;
 }
}

?>

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