Under LinuxRHEL4: DNS Server SETUP

Source: Internet
Author: User
Tags domain name server mail exchange nameserver
DNS server: (based on RedHatlinuxAS4) 1. Install dns server related software [root @ RHEL4RPMS] # rpm-ivhbind-9.2.4-2.i386.rpm [root @ RHEL4RPMS] # rpm-ivhbind-chroot-9.2.4-2.i386.rpm // to enhance dns server security [root @ RHEL4RPMS] # rpm-ivhbind-

DNS server: (based on RedHat linux AS 4)
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 "linuxidc.com" IN {
Type master; // indicates the master Domain Name Server
File "linuxidc.com. zone"; // defines the database file for forward region resolution.
Allow-update {none ;};
};

# Reverse region Declaration
Zone "0.168.192.in-addr. arpa" IN {
Type master; // indicates the master Domain Name Server
File "192.168.0.rev"; // defines the reverse region resolution database file
Allow-update {none ;};
};
Save and exit
Create the linuxidc.com. zone and 192.168.0.rev files 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/linuxidc.com. zone

$ TTL 86400
@ In soa @ root (
42; serial (d. adams)
3 H; refresh
15 M; retry
1 W; expiry
1D); minimum
In a 192.168.0.1 # Set the address record: Resolve the domain name to an IP address #
In ns linuxidc.com. # Set Domain Name Service records #
In mx 5 linuxidc.com. # Set the mail exchange record. Used by the matching email server #
Mail in cname linuxidc.com. # Set the alias record #
Www in cname linuxidc.com. # Set the alias record #

Save and exit
4. Configure reverse region resolution database files:
Add the following code to it:
Vi/var/named/chroot/var/named/192.168.0.rev

$ TTL 86400
@ In soa localhost. root. localhost .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns linuxidc.com. # Set Domain Name Service records #
1 in ptr linuxidc.com. # Set reverse pointer record #
Save and exit

5. Change the/etc/resolv. conf file as follows:
Domain linuxidc.com
Nameserver 192.168.0.1
Search linuxidc.com

6. Change permissions
Chown named: named linuxidc.com. zone

Chown named: named 192.168.0.rev
7. Restart the service
Service named restart
8. Test the DNS server

1. Test on this server:

(1) host www.linuxidc.com
Host 192.168.0.1

(2) dig www.linuxidc.com @

Dig 192.168.0.1

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.0.1

Start/run/cmd nslookup

Forward resolution:> www.linuxidc.com or linuxidc.com. Or linuxidc.com

Reverse resolution:> 192.168.0.1


9. (1) check whether the regional file is incorrect.
Named-checkzone/var/named/chroot/var/named/linuxidc.com. zone
Named-checkzone/var/named/chroot/var/named/192.168.0.rev
(2) Check the configuration file
Name-checkconfig/etc/named. conf
10. the DNS server configuration is complete and can be used.

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.