dns zone import script

Discussion in 'Feature Requests' started by thomasadams, Nov 14, 2013.

  1. thomasadams

    thomasadams New Member


    I have an old bind server with more than 600 zones. I would like to upgrade that server and install ispconfig on it. The only problem is i cant finde anyhow to bulk import all the zones to ispconfig. Is that something that would be possible or already possible?
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Please have a look in the remoting_client/examples directory in the ISPConfig download.
  3. thomasadams

    thomasadams New Member

    Well i have no problem making a script from the api adding all the zones, but i cant figure out how to make it add every record for each zone.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    There are functions available for each record type in the remote api, e.g. dns_a_add(...), dns_cname_add(....) etc.
  5. Timmy Oblatus

    Timmy Oblatus New Member

    Using the API functions dns_add_a() etc, would required something that can already parse the actual zone files, I think what he is looking for is a way to have ISP Config look at a directory which stores alle a bunch of zone files from bind or something like that, and have ISP Config import all data of these zones.

    Much like how you on a PowerDNS server using PowerAdmin can bulk create a number of zones as slave/master and have PowerAdmin process these and add to the database backend etc.

    This would be quite a usefull feature, when moving towards an ISPConfig based environment.
  6. Thomas CARTER

    Thomas CARTER New Member

    Hi, it would be really good to have functions to pass data and parameters from one ISPConfig to another. In the meantime this is what I did to transfer 200+ DNS zones from an old ISPConfig server to 2 new ones (ISPConfig, getting round the NS problem flagged elsewhere. I like to keep my ISPConfigs separate for security so I effectively have 2 primary dns's:

    1) Deactivate any obsolete zones
    2) Make a list of all the good domains
    3) Zip /etc/bind/ and unzip to my local PC (you get all the deactivated zones too)
    4) Remove the 'pri.' prefix so import can correctly guess domain name.

    4) Import the good domain zones one by one with ISPConfig, DNS, Zone File Import (used default/empty field values so surprisingly quick: Select file, import, select file, import...). Each zone has NS records removed and replaced just with NS ns1.mydomaine.tld, so...
    5) Export the table dbispconfig.dns_rr in SQL format, extract the NS ns1.mydomaine.tld records, replace ns1 with ns2 and reimport with SQL INSERT
    6) This is a good moment to correct TTLs and other mistakes in dns_rr
    7) Resync /etc/bind/ with ISPConfig, Tools, Resync, Resync DNS records

    8) Copy tables dbispconfig.dns_rr and dbispconfig.dns_soa from NEW SERVER (phpAdmin Export/Import)
    9) Resync /etc/bind/ with ISPConfig, Tools, Resync, Resync DNS records. This created all the zone files in /etc/bind/
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    This can be done with the remote api esaily with afew lines of code, so no need to do this on DB level.

Share This Page