2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 10:10:06 +00:00
bind/doc/design/zone

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

253 lines
6.9 KiB
Plaintext
Raw Normal View History

<!--
1999-03-04 01:47:40 +00:00
Copyright (C) Internet Systems Consortium, Inc. ("ISC")
1999-03-11 00:17:36 +00:00
SPDX-License-Identifier: MPL-2.0
2000-08-09 04:37:43 +00:00
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.
2000-08-09 04:37:43 +00:00
See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
-->
1999-02-25 05:15:42 +00:00
Zones
Overview
1999-02-25 05:15:42 +00:00
Zones are the unit of delegation in the DNS and may go from holding
RR's only at the zone top to holding the complete hierarchy (private
1999-03-11 00:17:36 +00:00
roots zones). Zones have an associated database which is the
container for the RR sets that make up the zone.
1999-02-25 05:15:42 +00:00
Zone have certain properties associated with them.
* name
* class
* primary / secondary / stub / hint / cache / forward
1999-02-25 05:15:42 +00:00
* serial number
* signed / unsigned
* update periods (refresh / retry) (secondary / stub)
1999-02-26 21:32:10 +00:00
* last update time (slave / stub)
1999-02-25 05:15:42 +00:00
* access restrictions
* transfer restrictions (primary / slave)
* update restictions (primary / slave)
1999-02-26 21:32:10 +00:00
* expire period (slave / stub)
1999-02-25 05:15:42 +00:00
* children => bottom
* glue
1999-02-26 21:32:10 +00:00
* rrsets / data
1999-02-25 05:15:42 +00:00
* transfer "in" in progress
* transfers "out" in progress
* "current" check in progress
* our primaries
* primary server name (required to auto generate our primaries)
1999-02-26 21:32:10 +00:00
* master file name
* database name
1999-03-11 00:17:36 +00:00
* database type
* initially only master_file (BIND 4 & 8)
* expanded axfr + ixfr
1999-02-26 21:32:10 +00:00
* transaction logs
* notification lists
* NS's
* static additional sites (stealth servers)
1999-03-11 00:17:36 +00:00
* dynamically learned sites (soa queries)
1999-02-25 05:15:42 +00:00
1999-03-03 12:20:05 +00:00
Zones have two types of versions associated with them.
1999-02-25 05:15:42 +00:00
1999-03-03 12:20:05 +00:00
Type 1.
The image of the "current" zone when a AXFR out is in progress.
There may be several of these at once but they cease to need
1999-03-11 00:17:36 +00:00
to exist once the AXFR's on this version has completed. These
are maintained by the various database access methods.
1999-03-03 12:20:05 +00:00
Type 2.
These are virtual versions of the zone and are required to
support IXFR requests. While the entire contents of the old
version does not need to be kept, a change log needs to be
kept. An index into this log would be useful in speeding
up replies. These versions have an explicit expiry date.
1999-03-03 12:20:05 +00:00
"How long are we going to keep them operationally?"
1999-02-26 21:32:10 +00:00
While there are expriry dates based on last update /
change time + expire. In practice holding the deltas
for a few refresh periods should be enough. If the network
and servers are up one is enough.
1999-03-03 12:20:05 +00:00
"How are we going to generate them from a master file?"
1999-02-26 21:32:10 +00:00
UPDATE should not be the only answer to this question.
We need a tool that takes the current zone & new zone.
Verifies the new zone, generates a delta and feeds this
at named. It could well be part of ndc but does not have
to be.
1999-02-25 05:15:42 +00:00
Zones need to have certain operations performed on them. The need to
be:
* loaded
* unloaded
* dumped
1999-02-26 21:32:10 +00:00
* updated (UPDATE / IXFR)
* copied out in full (AXFR) or as partial deltas (IXFR)
1999-02-25 05:15:42 +00:00
* read from
1999-02-26 21:32:10 +00:00
* validated
1999-02-25 05:15:42 +00:00
* generate a delta between two given versions.
1999-02-26 21:32:10 +00:00
* signed / resigned
1999-03-04 01:47:40 +00:00
* maintenance
1999-02-26 21:32:10 +00:00
validate current soa
1999-03-03 12:20:05 +00:00
remove old deltas / consolidation
1999-02-26 21:32:10 +00:00
purge stale rrsets (cache)
* notification
responding to
generating
1999-03-11 00:17:36 +00:00
While not strictly a nameserver function, bad delegation and bad
slave setups are continual and ongoing sources of problems in the
DNS. Periodic checks to ensure parent and child servers agree on
the list of nameservers and that slaves are tracking the changes
made in the primary server's zone will allow problems in
1999-03-11 00:17:36 +00:00
configurations to be identified earlier providing for a more stable
DNS.
Compatibility:
Zones are required to be configuration file compatible with
1999-03-11 00:17:36 +00:00
BIND 8.x.
1999-02-26 21:32:10 +00:00
Types:
typedef enum {
dns_zone_none = 0,
dns_zone_primary,
dns_zone_secondary,
dns_zone_mirror,
1999-02-26 21:32:10 +00:00
dns_zone_stub,
dns_zone_hint,
dns_zone_cache,
dns_zone_forward
} dns_zonetypes_t;
1999-03-03 12:20:05 +00:00
typedef struct dns_ixfr dns_ixfr_t;
struct dns_ixfr {
1999-03-04 01:47:40 +00:00
unsigned int magic; /* IXFR */
uint32_t serial;
1999-03-03 12:20:05 +00:00
time_t expire;
unsigned int offset;
ISC_LINK(dns_ixfr_t) link;
};
1999-02-26 21:32:10 +00:00
struct dns_zone {
unsigned int magic; /* ZONE */
dns_name_t name;
dns_rdataclass_t class;
dns_zonetypes_t type;
1999-03-04 01:47:40 +00:00
dns_bt_t top;
uint32_t version;
uint32_t serial;
uint32_t refresh;
uint32_t retry;
uint32_t serial;
1999-02-26 21:32:10 +00:00
char *masterfile;
dns_acl_t *access;
dns_acl_t *transfer;
struct {
dns_acl_t *acl;
dns_scl_t *scl; /* tsig based acl */
} update;
char *database;
1999-03-03 12:20:05 +00:00
ISC_LIST(dns_ixfr_t) ixfr;
1999-02-26 21:32:10 +00:00
...
};
Operations:
Loading:
Functions:
1999-02-25 05:15:42 +00:00
1999-03-04 01:47:40 +00:00
void
dns_zone_init(dns_zone_t *zone, dns_rdataclass_t class, isc_mem_t *mxtc);
void
dns_zone_invalidate(dns_zone_t *zone);
1999-03-04 01:47:40 +00:00
void
dns_ixfr_init(dns_ixfr_t *ixfr, unsigned long serial, time_t expire);
void
dns_ixfr_invalidate(dns_ixfr_t *ixfr);
dns_zone_axfrout(dns_zone_t *zone);
Initiate outgoing zone transfer.
dns_zone_axfrin(dns_zone_t *zone, isc_sockaddr_t *addr);
Initiate transfer of the zone from the given server or the
primary servers listed in the zone structure.
1999-03-04 01:47:40 +00:00
dns_zone_locateprimary(dns_zone_t *zone);
Working from the root zone locate the primary server for the zone.
Used if primaries are not given in named.conf.
1999-03-04 01:47:40 +00:00
dns_zone_locateservers(dns_zone_t *zone);
Working from the root zone locate the servers for the zone.
Primary server moved to first in list if in NS set. Remove self
1999-03-04 01:47:40 +00:00
from list.
Used if primaries are not given in named.conf.
1999-03-04 01:47:40 +00:00
dns_zone_notify(dns_zone_t *);
Queue notify messages.
dns_zone_checkparents(dns_zone_t *);
check that the parent nameservers NS lists for this zone agree with
the NS list this zone, check glue A records. Warn if not identical.
This operation is performed on primary zones.
1999-03-04 01:47:40 +00:00
dns_zone_checkchildren(dns_zone_t *);
check that the child zones NS lists agree with the NS lists in this
zone, check glue records. Warn if not identical.
dns_zone_checkservers(dns_zone_t *);
1999-03-04 01:47:40 +00:00
check that all the listed servers for the zone agree on NS list and
serial number. NOTE only errors which continue over several refresh
periods to be reported.
dns_zone_dump(dns_zone_t *, FILE *fp);
Write the contents of the zone to the file associated with fp.
dns_zone_validate(dns_zone_t *);
Validate the zone contents using DNSSEC.
dns_zone_tordatalist(dns_zone_t *zone, dns_rdatalist_t *list)
dns_zone_addmaster(dns_zone_t *zone, isc_sockaddr_t *addr);
1999-03-03 12:20:05 +00:00
Add addr to the set of primaries for the zone.
1999-03-03 12:20:05 +00:00
1999-03-04 01:47:40 +00:00
dns_zone_clearmasters(dns_zone_t *zone);
Clear the primary set.
1999-03-04 01:47:40 +00:00
dns_zone_setreadacl(dns_zone_t *, dns_acl_t *)
dns_zone_setxfracl(dns_zone_t *, dns_acl_t *)
dns_zone_addnotify(dns_zone_t *, isc_sockaddr_t *addr, bool perm);
1999-03-04 01:47:40 +00:00
dns_zone_clearnotify(dns_zone_t *)
dns_zone_load(dns_zone_t *);
dns_zone_consolidate(dns_zone_t *);
1999-03-04 01:47:40 +00:00
Consolidate on disk copy of zone.