[Multi Server] Transfer all records ?

snk00sj

Verified User
Joined
Apr 24, 2005
Messages
7
Hi, i want to say thanks for the great new addition to DirectAdmin.

Is there any way to update all the dns records to another server ?

Now only the domains that are adjusted get transferred to the added server, but i want to transfer all my current domains....any way todo that ?

Thank you.
 
Last edited:

Icheb

Verified User
Joined
Sep 15, 2003
Messages
556
Location
The Netherlands
2 options:
1. Do a nice rm -Rf on the target server so that Bind has to download them all again.
2. Upgrade the SOA by 1 on all zones on the source server, restart/reload Bind, go to the target server and let it sync again. (This can take upto the set TTL time for a zone).

This script allows you to upgrade your SOA records: http://www.dns.net/dist/zsu/
Just create a bash script to do it for all your domains...
 

squirrelhost

Verified User
Joined
Feb 21, 2004
Messages
174
Location
Marylebone, London
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue

as given elsewhere by support, will
copy all data to your target server.

there's no master/slave relationship
set up here really (you can do yourself)
and for basic security you should be
using

allow-transfer { none; }

in your named.conf for all zones by default.
 

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
Icheb said:
2 options:
1. Do a nice rm -Rf on the target server so that Bind has to download them all again.
2. Upgrade the SOA by 1 on all zones on the source server, restart/reload Bind, go to the target server and let it sync again. (This can take upto the set TTL time for a zone).

You don't need to update the serial number in the SOA. If you remove all the zone files and restart named the local server won't know what the last serial number was and will request all the files.
This script allows you to upgrade your SOA records: http://www.dns.net/dist/zsu/
Just create a bash script to do it for all your domains...
You shouldn't need it on DA because this command:
Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
Will rewrite all the zone files and update the serial numbers as it does so.

Jeff
 

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
squirrelhost said:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue

as given elsewhere by support, will
copy all data to your target server.

there's no master/slave relationship
set up here really
Your confusing me because as far as I know the above command rewrites all zones on the local server but doesn't discriminate slave zones so it won't ask the master server to resend them. Am I missing something?

The original poster was referring a recently added function whereby DA can manage slave zones.

Jeff
 

squirrelhost

Verified User
Joined
Feb 21, 2004
Messages
174
Location
Marylebone, London
it's exactly how i coped over all
zone files to two 'external' servers.

if you've set up multi-server etc,
which you're referring to, this
will trigger copying to external
server(s) also.
 

nobaloney

NoBaloney Internet Svcs - In Memoriam †
Joined
Jun 16, 2003
Messages
26,119
Location
California
Okay, you're running it on the master. Somehow I thought you were running it on the slave.

Jeff
 

SeLLeRoNe

Super Moderator
Joined
Oct 9, 2004
Messages
6,800
Location
A Coruña, Spain
Sorry.. if i do

echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue

and restart named in all two servers that i have.. i will have the same data in all?

Thanks
 

squirrelhost

Verified User
Joined
Feb 21, 2004
Messages
174
Location
Marylebone, London
if you've enabled multi-server feature
on server A, to copy ot server B,
then running this on server A will
effectively copy the current set of data
from server A to server B,

and write a new named.conf on server
B also.
 

resolveit

Verified User
Joined
Mar 22, 2004
Messages
764
Hi,

Just to clear up a something...

If I do

Code:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue

it will rewrite all the zone files and the named.conf.

Won't I loose all the (custom) changes made to the DNS records?
 

squirrelhost

Verified User
Joined
Feb 21, 2004
Messages
174
Location
Marylebone, London
all you're doing is copying over the
latest versions, which are freshly
re-written on the original server,
server A. And putting these new
versions onto server B, with all your
changes you've made.

no custom changes would be lost,
I've just checked on a server here,
and you can try it without breaking
anything at all.

log onto server B also, have a
look at any new file in /etc/namedb/

they're hopefully as you'd expect.
 

resolveit

Verified User
Joined
Mar 22, 2004
Messages
764
Thanks I was just testing it on my test server...

Another issue of course is that it's only efective if you update the NS records of each zone file and also update the ns records at the registrar.
 

squirrelhost

Verified User
Joined
Feb 21, 2004
Messages
174
Location
Marylebone, London
than again all depends on what you want to do.

you could have, for example 2 DA servers,
set up already, and maybe not much on them.

suppose your main domain, blah.com is on
server A. you could take an IP address
from server A, and take one from server B.

go to your registrar and register these as
ns1.blah.com and ns2.blah.com.

edit blah.com zone file on server A to use
these nameservers. set up multi-server on
server A to push to server B.

you could use server B for assorted reseller
sites, or assorted user sites, handling all of
the dns for that independently on server B
ignoring everything else, with maybe
nameservers for the reseller, or for you own
private reseller account you set up on it,
doesn't matter, you're free to fiddle around.

Then, what if you want to add more servers....

on each new server, at set up, change
admin settings to use ns{1,2}.blah.com
and you could set the hostname as
boxX.blah.com (x = 1,2,3....) depending
on which server. set up every new box
with multi server to push to server A and
server B. every new account you add
on these new servers would use
ns{1,2}.blah.com as nameservers, and
the zone files all get pushed to server A
and server B as you want.

you could end up with, say, 10
'additional' servers. all domains on them
now set up to use ns{1,2}, and any
new or edited zone files being pushed to
server A and server B. Only
these servers will be answering to dns
queries as they're the only ones you've
set up at your registrar.

no more having to have ns{1,2} on server1,
then ns{3,4} on server 2, and ns{5,.6}
on server 3, etc......

you don't even need to have any domains
on your first 2 DA servers, get 2o low
price ones, and you now have
2 servers devoted to dns. nice.
 

resolveit

Verified User
Joined
Mar 22, 2004
Messages
764
Yes you're right and it's a breeze when you only have a couple of domains on the servers, I could edit them manually and all would be fine but I have 2000+ domains spread accross 4 servers each having the local ns records (2 NS records with IP's pointing to the server itself).

Now having set up multi-server I want all the zones to reflect 4 NS servers, one from each physical server.

I'm looking for a quick and effective way to update 2000+ zones. Anyone have a suggestion? Before you tell me to create a custom named.db in /usr/local/directadmin/data/templates/custom with the new nameservers and then use the command in this thread.... I've tried it and the new NS records are NOT reflected in the zone files.
 

squirrelhost

Verified User
Joined
Feb 21, 2004
Messages
174
Location
Marylebone, London
you can't do the trick Jeff mentioned
here recently?

it would involve a custom named.db file.

move the namedb.db template into
the custom directory.

edit this, and remove the line:

|NS|

and add the lines:

|DOMAIN|. 14400 IN NS ns1.blah.com.
|DOMAIN|. 14400 IN NS ns2.blah.com.
|DOMAIN|. 14400 IN NS ns3.blah.com.
|DOMAIN|. 14400 IN NS ns4.blah.com.

wouldn't then doing a re-write produce
new zone files, each of which only
contains the four nameservers I put
in above ?
 
Last edited:

icepick

Verified User
Joined
Aug 19, 2005
Messages
122
Location
Auckland, New Zealand
squirrelhost said:
all you're doing is copying over the
latest versions, which are freshly
re-written on the original server,
server A. And putting these new
versions onto server B, with all your
changes you've made.

no custom changes would be lost,
I've just checked on a server here,
and you can try it without breaking
anything at all.

log onto server B also, have a
look at any new file in /etc/namedb/

they're hopefully as you'd expect.

Hi,

As you mentioned there should be a 'slave' entry in the new named.conf , however this is not the case for me, i also do not see any new zones in the /etc/named/ folder.

Seems like this function doesnt actually work?
 

resolveit

Verified User
Joined
Mar 22, 2004
Messages
764
It only transfers zones when they are modified.

Edit the DNS of any domain on server A and wait 2 minutes and then check to see if the zone is now on server B. This works for me :)
 

icepick

Verified User
Joined
Aug 19, 2005
Messages
122
Location
Auckland, New Zealand
ok ok

Ok, I found the issue, On slave servers the user has to be an admin ,it wont work if you make the user a reseller.

Now all the zones are present on my backup system, however How do I add the following records to ALL my zones.

domain.co.nz. @ ns3.blah.com.

If i dont do this then ns3 wont be used.
 
Top