In RHEL4, configure the DNS server (for details)-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Configure the DNS server in RHEL4 (fuqin liquor cooking)
1. Install dns Software
[Root @ RHEL4 RPMS] # rpm-ivh bind-9.2.4-2.i386.rpm
[Root @ RHEL4 RPMS] # rpm-ivh bind-chroot-9.2.4-2.i386.rpm // to enhance dns server security
[Root @ RHEL4 RPMS] # rpm-ivh bind-libs-9.2.4-2.i386.rpm
[Root @ RHEL4 RPMS] # rpm-ivh bind-utils-9.2.4-2.i386.rpm
[Root @ RHEL4 RPMS] # rpm-ivh caching-nameserver-7.3-3.noarch.rpm // generate a dns configuration Template File
2. Configure the configuration file in which dns works normally (if you do not know where the configuration file is located: Query with rpm-ql bind)
/Etc/named. conf is a symbolic link pointing to/var/named/chroot/etc/named. conf
/Var/named/chroot/etc/* // list the "General" configuration files that the dns server works normally.
/Var/named/chroot/var/named/* // list the "region" configuration file for the dns server to work normally
3. General configuration file named. conf
Add the code to it on the basis of the original
Vi/var/named/chroot/etc/name. conf
# Forward region Declaration
Zone "test.com" IN {
Type master; // indicates the master Domain Name Server
File "test.com. zone"; // defines the database file for forward region resolution.
Allow-update {none ;};
};
# Reverse region Declaration
Zone "1.168.192.in-addr. arpa" IN {
Type master; // indicates the master Domain Name Server
File "192.168.1.zone"; // defines the reverse region resolution database file
Allow-update {none ;};
};
Save and exit
Create the file test.com in/var/named/chroot/var/named. after chroot is set for zone and 192.168.1.zone, the DNS work environment is under/var/named/chroot/var/named.
3. Configure forward region resolution database file:
Add the following code to it:
Vi/var/named/chroot/var/named/test.com. zone
$ TTL 86400
@ In soa ns.test.com. root (
42; serial (d. adams)
3 H; refresh
15 M; retry
1 W; expiry
1D); minimum
@ In ns ns.test.com. # Set Domain Name Service records #
Ns in a 192.168.0.121 # Set the address record: Resolve the domain name to an IP address #
Www in cname ns.test.com. # Set the alias record #
@ In mx 5 www.test.com. # Set the mail exchange record. Used by the matching email server #
Save and exit
4. Configure reverse region resolution database files:
Add the following code to it:
Vi/var/named/chroot/var/named/192.168.1.zone
$ TTL 86400
@ In soa ns.test.com. localhost. root. localhost .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
@ In ns ns.test.com. # Set Domain Name Service records #
121 in ptr ns.test.com. # Set reverse pointer record #
Save and exit
6. Change permissions
Chown named: named test.com. zone
Chown named: named 192.168.1.zone
7. Restart the service
Service named restart
8. Test the DNS server
1. Test on this server:
(1) host www.test.com
Host 192.168.0.121
(2) dig www.test.com@192.168.1.121
2. Test on the client (windows platform:
Change the IP address to the same network segment as the server, the gateway is empty, and the DNS directs to the server's IP Address: 192.168.1.121
Start/run/cmd nslookup
Forward resolution:> www.test.com, ns.test.com, or test.com
Reverse resolution:> 192.168.0.121
9. (1) check whether the regional file is incorrect.
Named-checkzone test.com/var/named/chroot/var/named/test.com. zone
Named-checkzone test.com/var/named/chroot/var/named/192.168.1.zone
(2) Check the configuration file
Name-checkconfig/etc/named. conf
10. the DNS server configuration is complete and can be used.
DNS tips:
1. The simplest test command is ping, for example, ping www.teset.com. the most used nslookup can be tested in an interactive environment. Therefore, ping and nslooku are one of the most used test commands, while dig is less used in reality due to its complexity: dig-x 192.168.1.102 reverse query.
2. rndc reload can be updated in real time without disabling the bind service, which is one of the most convenient commands.
3. If the test result shows a Non-authoritative answer: // unauthorized answer, it indicates that the answer comes from other DNS servers or caches.
4. Secondary DNS servers have two main functions: one is backup of the primary NDNS server and the other is load sharing of the primary NDS server. zone transfer refers to the process in which the secondary DNS copies the regional database files from the master DNS server. The following three mechanisms enable regional transmission: first, the secondary DNS server has just started; second, the interval between refreshing in the SOA record has arrived; and third, the master DNS has set the active notification that the secondary DNS data has changed.
The above is what I encountered when I used DNS in real life. I will share it with you to improve it together (fuqin cooking)
For details about RHEL4's DDNS settings, refer:
Http://hi.baidu.com/yuhongchun027/blog/category/bind%C6%AA
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service