Simple DNS Server Configuration
1: Install DNS-related packages
Bind-chroot-9.3.4-10.P1.el5
Bind-libs-9.3.4-10.P1.el5
Ypbind-1.19-11.el5
Bind-utils-9.3.4-10.P1.el5
Bind-9.3.4-10.P1.el5
Rpm-ivh
For example: rpm-ivh ind-chroot-9.3.4-10.P1.el5 others are also installed like this.
2: you also need to install a DNS reference package to facilitate the installation of DNS
That is, caching-nameserver-9.3.4-10.P1.el5.i386.rpm
Rpm-ivh caching-nameserver-9.3.4-10.P1.el5.i386.rpm
3: configure the DNS master configuration file
Cd/var/named/chroot/etc
Then cp-p named. caching-nameserver.conf named. conf
4: Edit named. conf
Vim named. conf
Change the localhost of Lines 15, 27, 36, and 37 to any.
Save and exit wq
5: vim named. rfc1912.zones
Copy the lines 15-19 and paste the changes.
Set
Zone "localdomain" IN {
Type master;
File "localdomain. zone ";
Allow-update {none ;};
};
Change
Zone "abc.com" IN {
Type master;
File "abc.com. db ";
Allow-update {none ;};
};
6: cd/var/named/chroot/var/named
Cp-p localhost. zone abc.com. db
Edit
Vim abc.com. db
The content is changed:
$ TTL 86400
@ In soa ns.abc.com. root.sina.com .(
42; serial (d. adams)
3 H; refresh
15 M; retry
1 W; expiry
1D); minimum
In ns ns.abc.com.
Ns in a 192.168.100.60
Www in a 1.1.1.1
Ftp in a 2.2.2.2
Mail in a 3.3.3.3
@ In mx 10 mail
Pop3 in cname mail
Smtp in cname mail
6: Save and exit after editing, and then start the DNS server.
Service named restart;
7. test whether the DNS server is configured successfully.
Test 1: Nslookup www.abc.com
Correct results
Server: 127.0.0.1
Address: 127.0.0.1 #53
Name: www.abc.com
Address: 1.1.1.1
Test 2: Nslookup mail.abc.com
Server: 127.0.0.1
Address: 127.0.0.1 #53
Name: mail.abc.com
Address: 3.3.3.3
Test 3: Nslookup ftp.abc.com
Server: 127.0.0.1
Address: 127.0.0.1 #53
Name: ftp.abc.com
Address: 2.2.2.2
Test 4: Nslookup ns.abc.com
Server: 127.0.0.1
Address: 127.0.0.1 #53
Name: ns.abc.com
Address: 192.168.100.60
Configure secondary DNS servers
Note: continue with the above experiment as the basis
1: The above Master DNS Server
2: now we have another host to configure secondary DNS servers.
3: first install the package required by DNS for this new machine and configure the DNS server. As described above, if you do not refer to the above
4: Start the DNS server after installation
Service named start
5: configure the primary configuration file of the DNS secondary server
Cd/var/named/chroot/etc
Then cp-p named. caching-nameserver.conf named. conf
Vim named. conf
Change the localhost of Lines 15, 27, 36, and 37 to any.
Save and exit wq
6: vim named. rfc1912.zones
Copy the lines 15-19 and paste the changes.
Set
Zone "localdomain" IN {
Type master;
File "localdomain. zone ";
Allow-update {none ;};
};
Change
Zone "abc.com" IN {
Type slave;
Master {192.168.100.60 ;};
Note that there must be at least one space at the front of the address, and there should be only one space at the end of the semicolon.
File "slaves/abc.com. db ";
};
7: Then run rndc reload to reload the data.
Author: "Fools note"