How to replace ip adresses in A DNS records all at once?

Discussion in 'Tips/Tricks/Mods' started by radim_h, Mar 19, 2008.

  1. radim_h

    radim_h Member

    Hello,
    i'm going to migrate my ISPConfig server to different provider with different IP range, togehter with other servers

    in Ispconfig DNS manager i have 150+ A records which are using more different IP adresses (ISPConfig server is authoritative DNS for itself and for more other servers)

    How should i replace one IP adress for all related sites without clicking them in DNS manager?
    I was looking into ispconfigdb structure, but haven't understand the structure of DNS in MySQL clearly (there is just few lines in "dns_a" table)

    I will also need to change IP for sites in ISPconfig site manager
    (menu ISP Manager->Sites-><i>Select Site</i>->Basis->IP adress

    can anyone help me?

    Assuming i have to change something in MySQL ispconfig database, how to force then the ISPConfig reread configuration from MySQL ?

    :confused:
     
  2. zcworld

    zcworld New Member

    this if your BIG TIME GAMED TO PLAY CHICKEN

    MAKE SURE YOU GOT FULL SQL BACKUP in CASE ALL GOES TO HELL!


    the way i done mine
    when my box IP changed and sent all of myDNS recoards out of order

    i done an sql dump of the myDNS and
    open it up in context ( a notepad editor)
    and found my 192.168.1.109 and replaced it with 192.168.1.103
    saved it and reloaded it into my sql server
    and
    DNS -> IP updated

    FULL SQL BACKUP in case you do this and stuff up
     
  3. radim_h

    radim_h Member

    ehh

    that seems to be a really dirty solution .)
    perhaps anyone has a better idea ?

    btw:zcworld, how did you that force the ISPConfig to change config files?
    is restarting ispconfig_server service enough ?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    But it should work. :)

    Try this:

    Code:
    UPDATE dns_isp_dns SET status = 'u';
    Then on the command line run
    Code:
    touch /home/admispconfig/ispconfig/.run
     
  5. radim_h

    radim_h Member

    Originally Posted by radim_h
    that seems to be a really dirty solution .)
    perhaps anyone has a better idea ?

    falko:
    But it should work.

    So is there options to chaneg IPs by SQL command anyhow ?
     
    Last edited: Mar 26, 2008
  6. falko

    falko Super Moderator Howtoforge Staff

    Of course, you can do that, but you might miss some records that contain the old IP.
     
  7. radim_h

    radim_h Member

    Thank you for advices!

    I'd realy like to update DNS records in MySQL shell, instead of replacing in notepad, can you tell me in which tables do i have to set new IP adress ?
    Are IP adresses also on different place then tables "dns_a" and "dns_isp_dns" ?
     
    Last edited: Mar 26, 2008

Share This Page