Most DNS cache servers exist in small enterprises. they are not responsible for domain name resolution and are only used to help users query domain name information from other DNS servers. The queried information is saved locally to facilitate the next use of the domain name. it is valid to shorten the domain name query time and save the local information. The following is... information &
Most DNS cache servers exist in small enterprises. they are not responsible for domain name resolution and are only used to help users query domain name information from other DNS servers. The queried information is saved locally to facilitate the next use of the domain name. it is valid to shorten the domain name query time and save the local information.
The specific configuration is as follows:
# Wget ftp: // 192.168.1.31/bind-9.8.1.tar.gz download source package
# Tar zxvf bind-9.8.1.tar.gz extract source package
# Cd bind-9.8.1 go to the decompressed Directory
#./Configure -- prefix =/usr/local/named -- enable-threads -- with-openssl = no pre-compilation configuration
# Make & make install compile and install
#/Usr/local/named/sbin/rndc-confgen>/usr/local/named/etc/rndc. conf generate the key file of the rndc control command
# Tail-10/usr/local/named/etc/rndc. conf | head-9 | sed s/# \ // g>/usr/local/named/etc/named. conf from rndc. extract named. key used by conf
# Vi/usr/local/named/etc/named. conf edit named. conf
Add the following content to named. conf:
# Specify the resource file storage path and pid file name.
Options {
Directory "/usr/local/named/dns/zone ";
Pid-file "/usr/local/named/dns/named. pid ";
};
# Point to the resource file with the server
Zone "." IN {
Type hint;
File "named. root ";
};
# Resource files recorded by local authoritative DNS
Zone "localhost" IN {
Type master;
File "localhost. zone ";
Allow-update {none ;};
};
# Resource files recorded by the local authoritative reverse DNS
Zone "0.0.127.in-addr. arpa" IN {
Type master;
File "localhost. rev ";
Allow-update {none ;};
};
# Mkdir-p/usr/local/named/dns/zone
# Cd/usr/local/named/dns/zone/enter the resource file storage directory
#/Usr/local/named/bin/dig | grep-v "^;">/usr/local/named/dns/zone/named. root uses the dig command to generate named. root service resource file
If you cannot access the Internet, you can also download the latest online named. root file.
The content of the named. root file is as follows:
. 3600000 in ns A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
A.ROOT-SERVERS.NET. 3600000 AAAA 2001: 503: BA3E: 2: 30
. 3600000 NS B .ROOT-SERVERS.NET.
B .ROOT-SERVERS.NET. 3600000 A 192.228.79.201
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
D.ROOT-SERVERS.NET. 3600000 AAAA 2001: 500: 2D: D
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET 3600000 A 192.5.5.241
F.ROOT-SERVERS.NET. 3600000 AAAA 2001: 500: 2F: F
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
H.ROOT-SERVERS.NET. 3600000 AAAA 2001: 500: 1: 803F: 235
. 3600000 NS I .ROOT-SERVERS.NET.
I .ROOT-SERVERS.NET. 3600000 A 192.36.148.17
I .ROOT-SERVERS.NET. 3600000 AAAA 2001: 7FE: 53
. 3600000 NS J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30
J.ROOT-SERVERS.NET. 3600000 AAAA 2001: 503: C27: 2: 30
. 3600000 NS K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
K.ROOT-SERVERS.NET. 3600000 AAAA 2001: 7FD: 1
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42
L.ROOT-SERVERS.NET. 3600000 AAAA 2001: 500: 3: 42
. 3600000 NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
M.ROOT-SERVERS.NET. 3600000 AAAA 2001: DC3: 35
# Vi localhost. zone: create resource files recorded by the local authoritative DNS
Add the following content:
$ TTL 86400
$ ORIGIN localhost.
@ 1D in soa @ root (
42; serial (d. adams)
3 H; refresh
15 M; retry
1 W; expiry
1D); minimum
1D in ns @
1D in a 127.0.0.1
# Vi localhost. rev create the resource file recorded by the local authoritative reverse DNS
Add the following content:
$ TTL 86400
@ In soa localhost. root. localhost .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns localhost.
1 in ptr localhost.
Start the DNS service.
#/Usr/local/named/sbin/named-4
This article is from the blog "The path to growth of Cui"