Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2017-11-07, 21:51:38

Author Topic: How to update DNS entries IP on all domains ?  (Read 1445 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 3,944
  • Karma: +1/-0
    • View Profile
How to update DNS entries IP on all domains ?
« on: 2013-08-06, 19:11:19 »
I've changed all IP's in my network so I have to change all DNS configs.

How to just update specific entries without rebuilding whole DNS template ?

Some customers have their own entries and I don't want to overwrite them.
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,381
  • Karma: +112/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to update DNS entries IP on all domains ?
« Reply #1 on: 2013-08-06, 19:41:36 »
It's hard to change for database but you can use this trick on template.

Imagine your old ip is 111.111.111.111 and new ip is 222.222.222.222. Copy /home/djbdns/tpl/domains.conf.tpl to custom.domains.conf.tpl and then edit this custom file:

from:
Code: [Select]
...
            case "a":
                $key = $o->hostname;
                $value = $o->param;
...
                if (isset($arecord[$value])) {
                    $rvalue = $arecord[$value];

...
Code: [Select]
...
            case "a":
                $key = $o->hostname;
                $value = $o->param;

if ($value === '178.32.23.43') { $value = '123.123.123.123'; }
...

                if (isset($arecord[$value])) {
                    $rvalue = $arecord[$value];

if ($rvalue === '111.111.111.111') { $rvalue = '222.222.222.222'; }

...

and then run 'sh /script/fixdns; /script/restart-services'.

Remember, this trick not change ip on database and still need change manually next times.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 3,944
  • Karma: +1/-0
    • View Profile
Re: How to update DNS entries IP on all domains ?
« Reply #2 on: 2013-08-06, 19:57:35 »
> Remember, this trick not change ip on database and still need change manually next times.

Why we cannot do this like this:

/script/update --parent-class=dns --parent-name=domain.pl --class=dns_record_a --v-ttype=a --v-hostname=ns3 --v-param=192.168.1.3
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,381
  • Karma: +112/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to update DNS entries IP on all domains ?
« Reply #3 on: 2013-08-06, 19:59:39 »
You can see config inside /home/djbdns/conf/master or /home/djbdns/tinydns/root/data
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 3,944
  • Karma: +1/-0
    • View Profile
Re: How to update DNS entries IP on all domains ?
« Reply #4 on: 2013-08-06, 22:45:51 »
Quote from: "MRatWork"
You can see config inside /home/djbdns/conf/master or /home/djbdns/tinydns/root/data

I don't have these folders because djbdns does not work properly on CentOS 6 ;)
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,381
  • Karma: +112/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: How to update DNS entries IP on all domains ?
« Reply #5 on: 2013-08-06, 23:50:39 »
Read on latest post of viewtopic.php?f=5&t=19167
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 3,944
  • Karma: +1/-0
    • View Profile
Re: How to update DNS entries IP on all domains ?
« Reply #6 on: 2013-08-07, 00:01:28 »
ok
« Last Edit: 1970-01-01, 01:00:00 by Guest »

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo

Page created in 0.038 seconds with 17 queries.

web stats analysis
 
Mirror created by MasterkinG32.CoM