If you run a large number of slave servers for a zone, the primary master name server can take quite a beating just keeping up with the slaves' polling to check that their zone data is current. There are a number of courses of action to take for this problem:
[59]rsync is a remote file synchronization program that transmits only the differences between files. You can find out more about it at http://rsync.samba.org.
[60]The file rdist reads to find out which files to update.
or for multiple primaries:dup-primary: # copy named.conf file to dup'd primary /etc/named.conf -> wormhole install ; # copy contents of /var/named (zone data files, etc.) to dup'd primary /var/named -> wormhole install ;
You can even have rdist trigger your name server's reload using the special option by adding lines like:dup-primary: primaries = ( wormhole carrie ) /etc/named.conf -> {$primaries} install ; /var/named -> {$primaries} install ;
These tell rdist to execute the quoted command if any of the files change.special /var/named/* "ndc reload" ; special /etc/named.conf "ndc reload" ;
Increasing your zone's refresh interval is another option. This slows down the propagation of new information, however. In some cases, this is not a problem. If you rebuild your zone data with h2n only once each day at 1 a.m. (run from cron) and then allow six hours for the data to distribute, all the slaves will be current by 7 a.m.[61] That may be acceptable to your user population. See Section 8.4.1, "Changing Other SOA Values" later in this chapter for more detail.
[61]And, of course, if you're using NOTIFY, they'll catch up much sooner than that.You can even have some of your slaves load from other slaves. Slave name servers can load zone data from other slave name servers instead of loading from a primary master name server. The slave name server can't tell if it is loading from a primary or from another slave. It's important only that the name server serving the zone transfer is authoritative for the zone. There's no trick to configuring this. Instead of specifying the IP address of the primary in the slave's configuration file, you simply specify the IP address of another slave.
Here are the contents of the file named.conf:
For a BIND 4 server, this would look slightly different.// this slave updates from wormhole, another // slave zone "movie.edu" { type slave; masters { 192.249.249.1; }; file "bak.movie.edu"; };
Here are the contents of the file named.boot:
When you go to this second level of distribution, though, it can take up to twice as long for the data to percolate from the primary master name server to all the slaves. Remember that the refresh interval is the period after which the slave name servers will check to make sure that their zone data is still current. Therefore, it can take the first-level slave servers the entire refresh interval before they get a new copy of the zone from the primary master server. Similarly, it can take the second-level slave servers the entire refresh interval to get a new copy of the zone from the first-level slave servers. The propagation time from the primary master server to all of the slave servers can therefore be twice the refresh interval.; this slave updates from wormhole, another slave secondary movie.edu 192.249.249.1 bak.movie.edu
One way to avoid this is to use the NOTIFY feature in BIND 8 and 9. This is on by default, and will trigger zone transfers soon after the zone is updated on the primary master. Unfortunately, it works only on Version 8 and 9 BIND slaves.[62] We'll discuss NOTIFY in more detail in Chapter 10, "Advanced Features".
[62]And, incidentally, on the Microsoft DNS Server.If you decide to configure your network with two (or more) tiers of slave name servers, be careful to avoid updating loops. If we were to configure wormhole to update from diehard and then accidentally configure diehard to update from wormhole, neither would ever get data from the primary master. They would merely check their out-of-date serial numbers against each other and perpetually decide that they were both up to date.
On a BIND 4 server, the named.boot file looks like this:options { directory "/var/named"; // or your data directory }; zone "0.0.127.in-addr.arpa" { type master; file "db.127.0.0"; }; zone "." { type hint; file "db.cache"; };
A caching-only name server can look up domain names inside and outside your zone, as can primary master and slave name servers. The difference is that when a caching-only name server initially looks up a name within your zone, it ends up asking one of the primary master or slave name servers for your zone for the answer. A primary or slave would answer the same question out of its authoritative data. Which primary or slave does the caching-only server ask? As with name servers outside your zone, it finds out which name servers serve your zone from one of the name servers for your parent zone. Is there any way to prime a caching-only name server's cache so it knows which hosts run primary master and slave name servers for your zone? No, there isn't. You can't use db.cache -- the db.cache file is only for root name server hints. And actually, it's better that your caching-only name servers find out about your authoritative name servers from your parent zone's name servers: you keep your zone's delegation information up to date. If you hard-wired a list of authoritative name servers on your caching-only name servers, you might forget to update it.directory /var/named ; or your data directory primary 0.0.127.in-addr.arpa db.127.0.0 ; for loopback address cache . db.cache
A caching-only name server's real value comes after it builds up its cache. Each time it queries an authoritative name server and receives an answer, it caches the records in the answer. Over time, the cache will grow to include the information most often requested by the resolvers querying the caching-only name server. And you avoid the overhead of zone transfers -- a caching-only name server doesn't need to do them.
Let's say we scare up the hardware for another name server. We'll call the new host zardoz.movie.edu, with IP addresses 192.249.249.9 and 192.253.253.9. We'll create a partial-slave name server on zardoz, with this named.conf file:
For a BIND 4 server, the named.boot file would look like this:options { directory "/var/named"; }; zone "movie.edu" { type slave; masters { 192.249.249.3; }; file "bak.movie.edu"; }; zone "249.249.192.in-addr.arpa" { type slave; masters { 192.249.249.3; }; file "bak.192.249.249"; }; zone "253.253.192.in-addr.arpa" { type slave; masters { 192.249.249.3; }; file "bak.192.253.253"; }; zone "0.0.127.in-addr.arpa" { type master; file "db.127.0.0"; }; zone "." { type hint; file "db.cache"; };
This server is a slave for movie.edu and only two of the 20 in-addr.arpa zones. A "full" slave would have 21 different zone statements in named.conf.directory /var/named secondary movie.edu 192.249.249.3 bak.movie.edu secondary 249.249.192.in-addr.arpa 192.249.249.3 bak.192.249.249 secondary 253.253.192.in-addr.arpa 192.249.249.3 bak.192.253.253 primary 0.0.127.in-addr.arpa db.127.0.0 cache . db.cache
What's so useful about a partial-slave name server? They're not much work to administer because their named.conf files don't change much. On a name server authoritative for all the in-addr.arpazones, we'd need to add and delete in-addr.arpa zones (and their corresponding entries in named.conf ) as our network changed. That can be a surprising amount of work on a large network.
A partial slave can still answer most of the queries it receives, though. Most of these queries will be for data in movie.edu and the two in-addr.arpa zones. Why? Because most of the hosts querying the name server are on the two networks it's connected to, 192.249.249 and 192.253.253. And those hosts probably communicate primarily with other hosts on their own network. This generates queries for data within the in-addr.arpa zone that corresponds to the local network.