Turning Linux into a DNS server ---------- Operating System: RedHat6.2
Source: Internet
Author: User
Let Linux Become a DNS server ---------- Operating System: RedHat6.2 -- Linux Enterprise Application-Linux server application information. For details, refer to the following. Turning Linux into a DNS server ---------- Operating System: RedHat 6.2
1. What is DNS
DNS stands for the domain name resolution server. Simply put, it is used to convert the domain name to the corresponding IP address, and reverse resolution of the IP address to the domain name. For more information about DNS, see the DNS article on this site.
Ii. Prerequisites
1. When installing Linux, you must install the DNS service and start DNS at the same time.
2. files that may be used
Directory where the file name is located
Named. boot/etc/"built-in system"
Named. conf/etc/"built-in system"
Named. local/var/named/"built-in system"
Name2ip (forward resolution)/var/named/"create or generate"
Ip2name (reverse resolution)/var/named/"create or generate"
Note: If you have configured the DNS Option When configuring the network after installing LINXU, you may only need to do a little work to complete the installation of the DNS service. Details are as follows:
Assume that your IP address is the internal IP address of the LAN: 192.168.0.88 Domain Name: mydomain.com
In the console, enter netconf and enter the detailed DNS information, that is, configure the DNS information in Domain Name Server (DNS), and then enter the command in the console: after ndc restart, two files of "forward resolution" and "reverse resolution" will be automatically generated in the "/var/named" directory. The file name should be: "192.168.0" and "mydomain.com", you only need to add the following format to complete the DNS configuration. You can also name these two files as long as you can understand them, but you must match them in the file named. conf.
3. The content of the preceding five files is as follows:
1. named. boot
;
; A caching only nameserver config
Directory/var/named (tell LinuxDNS where the configuration file is stored)
Chace named. ca
Primary 0.0.127.in-addr. arpa named. local
Primary mydomain.com
Primary 0.168.192.in-addr. arpa 192.168.0
# The functions of the following two lines are to send Domain Names that cannot be resolved locally to external domain names for resolution, mainly used for hosts in the LAN
Forwardes mydomain.com
Options forward-only
2. named. conf
;
Options {
Directory "/var/named ";
};
Zone "."{
Type hint;
File "named. ca ";
};
Zone "mydomain.com "{
Type master;
File "mydomain.com ";
};
Zone "0.0.127.in-addr. arpa "{
Type master;
File "named. local ";
};
Zone "0.168.192.in-addr. arpa "{
Type master;
File "192.168.0 ";
};
3. named. local
@ In soa localhost. root. localhost (
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns localhost.
1 in ptr localhost.
4. Forward parsing file: mydomain.com
@ In soa myname.mydomain.com root.myname.mydomain.com (
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
NS myname.mydomain.com.
MX 10 myname.mydomain.com.
;
Localhost in a 127.0.0.1
Myname in a 192.168.0.88
Www in a 192.168.0.88
Mail in a 192.168.0.88
Ftp in a 192.168.0.88
;
Myname CNAME myname.mydomain.com.
Www CNAME myname.mydomain.com.
Mail CNAME myname.mydomain.com.
Ftp CNAME myname.mydomain.com.
5. Reverse parsing file: 192.168.0
@ In soa myname.mydomain.com root.myname.mydomain.com (
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
NS myname.mydomain.com.
88 in ptr myname.mydomain.com.
So far, DNS configuration has been completed, and there are several related files, you can refer:
So far, the DNS configuration has been completed, and now you want to test, enter the following command in the console:
Ndc restart
Nslookup
There will be a prompt ">", you can enter your host name myname, and mail, ftp, www, the machine will parse the specific information, I believe you will succeed.
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