Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Syncing BIND
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
KePSuX
Guru
Guru


Joined: 29 Sep 2003
Posts: 312
Location: Fredericksburg Va

PostPosted: Tue Apr 06, 2004 9:40 pm    Post subject: Syncing BIND Reply with quote

I've got two machines at different physical locations running as DNS servers. One is a "master" and the other the "slave" (aka backup). I have the need for the slave to sync every 15 minutes off the master to keep the DNS records on each machine up to date. I'm not a Linux moron, but I dont know squat about BIND to be honest. Whats the best way about this? I *think* BIND has the ability to sync once a day..but this is just off a rough memory of something I had read. Any insight? Thanks!
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Tue Apr 06, 2004 10:16 pm    Post subject: Reply with quote

No need to sync as long as the master tells the slave whenever there is an update. You'd want something like this in your config on the master.

Code:

        allow-transfer { 10.10.10.1; 10.10.11.1; };
        notify yes;
        also-notify { 10.10.10.1; 10.10.11.1; };


This way the slave gets the notified when the master changes and pulls the new zone file. Never seen it take more than 5-15 secs.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
KePSuX
Guru
Guru


Joined: 29 Sep 2003
Posts: 312
Location: Fredericksburg Va

PostPosted: Tue Apr 06, 2004 11:05 pm    Post subject: Reply with quote

ok, awesome. Theoretically if when the master is updated and the slave is not present on the network, how does it handle that? Will it update when the other machine comes back up, or just skip it until manually synced?

Does bind have to be restarted on either machine when it is updated?

Will it re-sync the slave when only changes are made to a zone file, or only when the file is created?

basically...aside from changing the actual zone file, what else will have to be done for the DNS to sync on both boxes?


Last edited by KePSuX on Tue Apr 06, 2004 11:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
moby
n00b
n00b


Joined: 17 Dec 2002
Posts: 29

PostPosted: Tue Apr 06, 2004 11:14 pm    Post subject: Reply with quote

It will sync the next time the secondary server is up. You may have to make a quick change to kick off the sync process if you want it to happen right away.

Otherwise there may be a timeout value to when it will sync.

Also, the secondary may request a sync when it starts up. I haven't ever had to mess with th is, as my secondary servers are always up.

-moby
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Tue Apr 06, 2004 11:33 pm    Post subject: Reply with quote

Say the slave is down and missed the notify. When you start bind it should attempt to check all the zones and get the change within a minute after named starts. Just tested that so I know it works. :)

Now say you have a temp link between the sites and the slave missed the notify and you didn't restart it. To have the slave check in with the master can be done in the zone files. Let's look at an example.

Code:

$TTL    600
; domain33.com
@       IN      SOA     ns01.domain.com. dns-admin.ns01.domain.com. (
                        2004040601     ; serial #
                        6h             ; refresh
                        1h             ; retry
                        2w             ; expire
                        1h             ; minimum
                        )


You can mess with the refresh times to get the slave to check in with the master more often. This one says check with the master every 6 hours. If the refresh fails retry in another hour. If the master isn't around keep the existing zone for 2 weeks.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
KePSuX
Guru
Guru


Joined: 29 Sep 2003
Posts: 312
Location: Fredericksburg Va

PostPosted: Wed Apr 07, 2004 2:14 pm    Post subject: Reply with quote

Wow, excellent info guys. A few more questions before I get into setting this up.

What type of authentication method is used for syncing? How does the slave know to listen to the master machine? Is there a setup in the slave that tells it it is the slave to that particular machine?

Just so I know...when zones are updated or added does BIND have to be restarted? If so...does it automatically restart on the slave when it is updated by the master?

Basically the person that will be updating BIND dosen't have a lot of Linux experiance, and I'm hoping to make this as seemless as I can. Im hoping at the most all he will have to do to sync both machines is add or update a zone file and restart named through webmin.

Also just for my referance, when named is restarted..is it done gracefully or will it drop connections that are in progress if there are any?

Thanks again guys. I love these fourms.
Back to top
View user's profile Send private message
ARC2300
Apprentice
Apprentice


Joined: 30 Mar 2003
Posts: 267

PostPosted: Wed Apr 07, 2004 7:03 pm    Post subject: Reply with quote

IIRC, by default, BIND checks something like once per hour for a refreshed zone just in case it misses the notify for some reason. I think I read that in my BIND/DNS book. I could be wrong, though.

For authentication, you can make it as secure or insecure as you want. I actually use keys when syncing my nameservers. Since the key is contained in the named.conf file, that file is readable by named only, as is the directory containing named.conf (as well as the directories with my zone files in it).

As stated above, BIND checks to see if you have it configured as a master or slave. If it's a master, it just servers out DNS info. If it's a slave, it checks what address it is supposed to stay synchronized with, and (I believe) once an hour checks the zone serial numbers to make sure that things stay updated.

No, BIND doesn't have to be restarted. If you're using Gentoo, at a command line simply type (as root) "rndc reload" and it should reload all zone data and config files. "rndc reload zone (zonename)" reloads a specific zone, and "rndc refresh zone (zonename)" forces BIND to see if the zone has been updated. "rndc reconfig" simply reloads the config file.

When updating a zone, if you increment the serial number, you only need to reload the zone data for the master name server. The slave will sync up within a reasonable amount of time on its own.

Restarting named isn't even necessary. Just give him a basic login and make some aliases, suchas "zoneload" "zonerefresh" "reconfig". That's even easier than clicking around in webmin.

named will start gracefully. Or at least, in my experience, it has.
_________________
It's fun to take a trip
Put acid in your veins
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Wed Apr 07, 2004 10:08 pm    Post subject: Reply with quote

You might want to make the $40 investment for the O'Reily cricket book. Also there's a good pdf about Bind on the the ISC's website that answers alot of these as well.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
KePSuX
Guru
Guru


Joined: 29 Sep 2003
Posts: 312
Location: Fredericksburg Va

PostPosted: Wed Apr 07, 2004 11:02 pm    Post subject: Reply with quote

Dude, awesome info. I'm actually on my way to Borders anyways, so I'm gonna check out some books on BIND/DNS. I think I've gotten enough info here to get it working though. As usual, thanks a ton!
Back to top
View user's profile Send private message
ARC2300
Apprentice
Apprentice


Joined: 30 Mar 2003
Posts: 267

PostPosted: Thu Apr 08, 2004 1:19 am    Post subject: Reply with quote

For what it's worth, I've got the O'Reilly BIND/DNS book, and it's very informative and easy to read.

When I finish this, it's off to read the Samba book I go, and from there, who knows.
_________________
It's fun to take a trip
Put acid in your veins
Back to top
View user's profile Send private message
Chris W
l33t
l33t


Joined: 25 Jun 2002
Posts: 972
Location: Brisbane, Australia

PostPosted: Thu Apr 08, 2004 5:49 am    Post subject: Reply with quote

kashani wrote:
...Let's look at an example.
Code:

$TTL    600
; domain33.com
@       IN      SOA     ns01.domain.com. dns-admin.ns01.domain.com. (
                        2004040601     ; serial #
                        6h             ; refresh
                        1h             ; retry
                        2w             ; expire
                        1h             ; minimum
                        )
The vitally important part of this process is the serial number you see in the master zone file. When a slave checks for updates what it is really doing is checking for a serial number numerically larger than the one it currently has. You must ensure this number increases when a master zone file is modified in order for the update to be pushed out to slave servers. Typically, as in the example above, the serial number is constructed to contain the update date and increment i.e. YYYYMMDDNN where NN is the update number within the day. This scheme is good for 100 updates a day, ensures an increasing number, and has the benefit if flagging the last modify date.
_________________
Cheers,
Chris W
"Common sense: The collection of prejudices acquired by age 18." -- Einstein
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum