Author: Liuying Bo
Time: 2003-6-6 mail: liuyingbo@126.com, please correct
Reprint, please indicate the source and the author
surroundings
Operating system: Red Hat Linux
Nuclear version: 2.4.20-8
Download source code
FTP in Internet Software Consortium (ISC):
ftp://ftp.isc.org/isc/bind9/9.2.2/ Download Source Code Bind-9.2.2.tar.gz
The current highest RPM version is 9.2.1
RPM package can be downloaded: ftp: //updates.redhat.com/7.3/en/os/srpms/bind-9.2.1-1.7x.2.src.rpm
Decompression package
Gzip -d bind-9.2.2.tar.gz
// Generate bind-9.2.2.tar file after execution, bind-9.2.2.tar.gz does not exist
TAR XVF BIND-9.2.2.TAR
// Generate a directory BIND-9.2.2 after successful
Or TAR ZXVF Binf-9.2.2.tar.gz
// Generate a directory BIND-9.2.2 after successful
Compile
Environment variables need to be confirmed before compilation:
In operation ./configure needs to confirm the environment variables, these environment variables will affect compilation: (mainly to confirm the correctness of environment variables, if there is no lower environment variable, there is no relationship, execution ./configure will automatically configure)
CC
............... ..
Cflags
C Compiler Flags. Defaults to include -g and / or -o2 as supported by the compiler.
STD_CINCLUDES
System Header File Directories. Can BE Used to Specify WHERE Add-on Thread OR IPv6 Support IS, for Example. Defaults to Empty String.
STD_CDEFINES
Any Additional Preprocessor Symbols You Want Defined. Defaults to Empty String.
To Build Shared Libraries, Specify "--With-Libtool" on the configure command line.
Perform compilation and installation steps:
./configure
// Can ./configure --Help get help
/ / Automatically configure system information to generate some related files
Make all
Make Install
// Time is relatively long, and some Warning will not affect
Note: make Clean (Make Superclean)
// Unload
BIND is installed normally in the / usr / local directory, but can adjust the -prefix parameter setting through the configure command, such as ./configure --prefix = / usr / local format
This is successful!
Configure
District data file (DB.Domain and db.addr file) configuration
SOA Record: Guide to the area
NS Record: List of one name server in this area
Other records: Data related to the host in this area, including
A: Map of the name to the address
PTR: Map to the name
CNAME: Specification name (relative to alias)
a. For db.domain db.addr files
Bind8.2 After setting the $ TTL statement, set the default TTL (TIME TO LIVE Survival) value of $ TTL 86400 (or 1D, 24h, etc.)
b. For DB.Domain DB.Addr files
Next is SOA (Start of Authority) record, each db.domain
DB.Addr files must have a function of there is a SOA record. Our server enjoys the area YNCNC.NET
Authority, so the format is as follows:
... in SOA ns.yncnc.net. root.yncnc.net.
1; serial number
3h; 3 hours later refresh
15m; after 15 minutes, retry
1W; expire 1 after week
1D); negative cache TTL is 1 day
Where IN said the Internet
The first name behind the SOA (ns.yncnc.net.) Is the primary name server of the YNCNC.NET area. Second name (ROO
T.yncnc.net.) is an email that manages the person of the area.
c. For DB.Domain DB.Addr files
NS (Name Server) records a NS record for each authoritative name server of our area
Such as:
IN ns ns.yncnc.net.
d. For db.domain files
Address and alias records, create a map to the address, plus column / resource record
;
; Host address
; A representative address
Www.yncnc.net. in A 221.3.128.268
ns.yncnc.net. in A 221.3.131.4
Mail.yncnc.net. in A 221.3.131.5
;
Alias
CNAME (CANONICAL NAME, standard name)
Pop.yncnc.net. in cname mail.yncnc.net.
Pop3.yncnc.net. in cname mail.yncnc.net.
SMTP.YNCNC.NET IN CNAME MAIL.YNCNC.NET.
e. For DB.Addr files
PTR record, as follows
5.131.3.221.in-addr.arpa. In ptr mail.yncnc.net
Note: The address can only point to a name: standard name
The above is a variety of resource records in the complete area data file.
Bind configuration file ànamed.conf
Comment
/ ** /
//
#
Directory of district data files
Option {
DIRECTORY "/ var / named";
// Live zone data file
}
Description of the area data file
Zone "YNCNC.NET" in {
TYPE MASTER;
File "db.yncnc.net"
}
Configure root clue files
"in {
Type hint;
File "db.cache"
//ftp.rs.internic.net (198.41.0.6) Anonymous Download the latest named.boot in the Domain directory, rename
}
Address Match List ACL Syntax
ACL Name {address_match_lists;
Blackhole clause grammar, avoiding some addresses
Options {
/ * Do not make the private address corresponding * /
Blackhole {
10/8;
172.18 / 12;
192.168 / 16;
}
}
Build a secondary word server
Simply look similar to
Zone "YNCNC.NET" in {
TYPE MASTER;
File "db.yncnc.net";
}
Change to
Zone "YNCNC.NET" in {
TYPE SLAVE;
File "bak.yncnc.net";
MASTER {221.3.131.4;
// The address of its primary domain server
}
Configuration of email MX record in DNS
YNCNC.NET. IN MX 0 mail.yncnc.net
YNCNC.NET. IN MX 10 mail2.yncnc.net
/ / It is assumed that there are two mail servers, where 0, 10 is the priority of the configuration, the smaller the value, the higher the priority, the higher the priority of the configuration and the name of the specification must not be used.
Configuration parser
Main resolv.conf file
Search Directive: Search list, support 8 domain names
Nameserver directive: The address of the query name server, up to three
Options Directive: Debug, NDOTS, Attempts, Timeout, Rotate, No-check-names Several options
Sortlist instruction: Specify the subnet and network of priority to use, up to ten
Domain Directive: Specify local domain name