How to mass change DNS entries?

Discussion in 'ISPConfig 3 Priority Support' started by craig baker, Aug 13, 2022.

  1. craig baker

    craig baker Member HowtoForge Supporter

    supposed I have a lot of DNS entries with a NS record being xxx.yyy.ccc.com (under records) . and on the Zone page the NS record is also xxx.yyy.ccc.com
    if I want to change all the records to point to a new name server - is there a way to doing a mass change instead of changing them one at a time?
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Change it in the database with a decent SQL query and then run a resync for the DNS zones and records under Tools > Resync.
     
  3. craig baker

    craig baker Member HowtoForge Supporter

    any enlightening instructions? what table? just one? how do I affect just the records that have NS9 in them?
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Example:
    Open the ISPConfig database (usually dbispconfig) through phpMyAdmin or on the commandline by logging in and then running:
    Code:
    USE dbispconfig;
    Update the NS records (eventually run this multiple times when you want to multiple nameservers, e.g. ns1 becomes ns3 and ns2 becomes ns4:
    Code:
    UPDATE dns_rr
    SET data = "nsnew.example.com." WHERE data = "nsold.example.com." AND type = "NS";
    and for the zones (just once with the hostname of the main nameserver):
    Code:
    UPDATE dns_soa
    SET ns = "nsnew.example.com." WHERE ns = "nsold.example.com.";
     

Share This Page