- Specifies behavior of named
- Defines zones to the server, and specifies whether the server is a master or slave for that zone
- Format for BIND 8/9 is quite different from that of previous versions
- Statements are terminated by semicolons, and sometimes grouped with curly braces
- Looks a little bit like C or Perl
- Comments can be C style ( \/* ... */ (the backslash shouldn't be there, but I had to include it to make the rest show up), C++ style (// ... ) or shell style (# ... )
- File contents
- We won't go into the detail the book goes into, but we'll try to cover the basics
- include path;
- Can include other files, to keep files cleaner
- options
- Specifies configuration options for named
- About 30 in BIND 8, 50 in BIND 9
- Important ones include
- directory path;
- Defines the directory to which all relative pathnames will be relative
- allow-query, allow-transfer, blackhole
- Control how the server talks to other hosts
- logging
- BIND had extensive configurability of logging (enough so that the text gives it its own section)
- zone
- The main statement in the config file
- Defines zones, and what type they are (master, slave, hint, stub)
- See the examples for the idea
- Simplified example
options {
// directory where all the data files are stored
directory "/var/named";
};
zone "." {
type hint;
file "named.ca";
};
zone "wsu.edu" {
type master;
file "db.wsu";
};
zone "eecs.wsu.edu" {
type slave;
file "db.eecs";
masters {
134.121.64.1;
};
};
zone "it.wsu.edu" {
type master;
file "db.it";
};
zone "1.121.134.IN-ADDR.ARPA" {
type master;
file "db.134.121.1";
};
zone "math.wsu.edu" {
type slave;
file "db.math";
masters {
134.121.45.17;
};
};
- The bulk of the configuration of the DNS is done in "zone files"
- The files defined in the "zone" directive of named.conf for all zones for which you are master
- Special characters
- ; -- comment begin character
- @ -- current domain name
- () -- allow data to span lines
- * -- wild card
- Doesn't quite work intuitively
- Resource records
- Each bit of data in a zone is called a "resource record"
- Format of a resource record is [name] [ttl] [class] type data
- name
- The entity the resource record is associated with
- If omitted, then the previous name is used
- ttl
- time to live (in seconds)
- Defines how long to cache data
- Often omitted
- Default set by $TTL directive
- class
- "IN" for "internet" is the only class I've ever seen used
- type
- The type of the resource record (more later)
- data
- Exactly what goes here will depend on the type of the resource record
- SOA record
- "Start of Authority"
- Defines paramaters for zone
- Usually given as a multi-line record, with comments as reminders of what the data values are
- example:
it IN SOA centaur.it.wsu.edu. ip-register.wsu.edu. (
199904051 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
86400 ) ; minimum ttl
- NS record
- Defines authoritative name servers for a zone
- example:
it.wsu.edu. IN NS centaur.it.wsu.edu.
- The name field is often left blank, because these records usually come right after the SOA in a zone, and have the same name (the name of the zone)
- A record
- Defines an IP (IPv4) address for a name
- example:
unicorn IN A 134.121.1.1
- PTR record
- "Pointer"
- Defines a name for an IP address
- Defined in the "special" domain "in-addr.arpa" which allows mapping of the IP address hierarchy to the DNS hierarchy
- Example (in zone 1.121.134.in-addr.arpa.)
1 IN PTR unicorn.it.wsu.edu.
- MX record
- "Mail exchanger"
- Used to tell mail programs where to deliver mail messages
- Includes a "preference" paramater. Lower numbers mean more preferred hosts. Equal preference records are shuffled by the server in what's known as a "round robin"
- example (this is not current):
wsu.edu IN MX 10 pegasus.it.wsu.edu.
IN MX 20 cheetah.it.wsu.edu.
- CNAME record
- "Canonical name"
- Essentially an alias
- If there is a CNAME for a particular name, there can be no other records associated with that name
- See the text for an interesting use of CNAME records to deal with that fact that IP addresses that are CIDR-ized on something other than a byte boundary don't map too well into the in-addr.arpa domain
- example:
www.wsu.edu IN CNAME charlotte.it.wsu.edu.
- SRV record
- Defines the location of services
- Wasn't used much in the past
- Windows 2000 makes extensive use of SRV records, so they are becoming much more important
- Other records
- LOC
- Nice idea, not used very much
- TXT
- Just associates text with a name
- A6
- Examples
Zone it.wsu.edu
;
; Information Technologies
;
$ORIGIN wsu.edu.
it IN SOA centaur.it.wsu.edu. ip-register.wsu.edu. (
199904051 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
86400 ) ; minimum ttl
IN NS centaur.it.wsu.edu.
IN NS dns1.eecs.wsu.edu.
IN NS beta.tricity.wsu.edu.
$ORIGIN it.wsu.edu.
localhost IN A 127.0.0.1
;
www.scs IN CNAME mulder.scs.wsu.edu.
unicorn IN A 134.121.1.1
wsunix IN CNAME unicorn.it.wsu.edu.
Zone 1.121.134.IN-ADDR.ARPA (defines 134.121.1.* reverse lookups)
;
; db.134.121.1 - ITB / Server Net
;
$ORIGIN 121.134.in-addr.arpa.
1 IN SOA centaur.it.wsu.edu. ip-register.wsu.edu. (
199903171 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
86400 ) ; minimum ttl
IN NS centaur.it.wsu.edu.
IN NS dns1.eecs.wsu.edu.
IN NS beta.tricity.wsu.edu.
$ORIGIN 1.121.134.in-addr.arpa.
1 IN PTR unicorn.it.wsu.edu.
Zone wsu.edu
;
; db.wsu
;
$ORIGIN edu.
wsu IN SOA centaur.it.wsu.edu. ip-register.wsu.edu. (
199904021 ; serial
10800 ; refresh
3600 ; retry
604800 ; expire
86400 ) ; minimum ttl
IN NS centaur.it.wsu.edu.
IN NS dns1.eecs.wsu.edu.
IN NS beta.tricity.wsu.edu.
IN MX 10 pegasus.it.wsu.edu.
IN MX 20 cheetah.it.wsu.edu.
$ORIGIN wsu.edu.
localhost IN A 127.0.0.1
mail IN A 134.121.1.8
IN MX 0 cheetah.it.wsu.edu.
IN MX 10 pegasus.it.wsu.edu.