Quickly build a DNS server under Linux

Source: Internet
Author: User
Tags openssl touch command mail exchange

first, the terminology interpretation:
TTL time to Live buffer retention
Which domain does ORIGIN belong to
@ Generation Finger Domain
A space is required in the beginning
Start of the SOA line record type
Parameter: Forwarders {} points to an unresolved domain name jump to an external DNS service
Test method: Host domain name (host IP) use the Nslookup method to test the use of Dig @ns IP or domain name
Test mail Service dig domain name mx
MX mail exchange record in MX 10 domain name
--------------------------------------------------------------------------------------------------Second, the implementation steps:
1. Download the bind9.7 program installation package
2. Unzip the tar package TAR-ZXVF bind-9.7.4-p1.tar.gz
3. CD BIND-9.7.4-P1
Run./configure check run environment discovery not found for OpenSSL
4. Check if the OpenSSL program is installed
Rpm-qa|grep "open*"
5. Check that the package is installed to further check the installation path
RPM-QL openssh-server-3.6.1p2-18
6. Configure Environment variables
Environment variable cannot be configured correctly
7. Install the program using the method without OpenSSL
./configure--prefix=/usr/local/named--without-openssl
8. Compiling and installing the program
Make
9. Installation program
Make install
10. Configure the DNS server
./rndc-confgen >>/usr/local/named/etc/rndc.conf
11. Create named.conf
Tail-n rndc.conf >/etc/named.conf
12. Add in Name.conf
Options
{directory "/usr/local/named/var";};
Zone "."
{type hint; file "named.ca";};
13. Create the named.ca file in the/usr/local/named/var directory
14. Start the DNS service
Cd/usr/local/named/sbin
./named-c/etc/named.conf
15. Querying the root directory for DNS
Dig-t NS
If you echo the name server, continue to the next step
16, Dig-t NS >/usr/local/named/var/named.ca
17, Configuration named.conf
18./named-g (tail-f/var/log/messages) View error message Error source configuration file format error strictly configured according to profile template format
A) Copy the configuration file named.conf to the/USR/LOCAL/NAMED/ETC directory based on the error message
b) Hint that the file is missing directly using the Touch command to create the file touch Managed-keys.bind
c) strictly configure the named.conf file according to the configuration format
D) strictly configure forward parsing and reverse parsing zone files according to configuration formatThird, attach a successful demo for everyone to reference and learna) named.conf configuration# Use with the following in named.conf, adjusting the Allow list as needed:
Key "Rndc-key" {
Algorithm HMAC-MD5;
Secret "ucfizntrrcz+vd4la23fqa==";
};Controls {
inet 127.0.0.1 Port 953
#inet 127.0.0.1
Allow {127.0.0.1;} keys {"Rndc-key";};
};
# End of named.conf
Options {
Directory "/usr/local/named/var";
Pid-file "/usr/local/named/var/run/named/named.pid";
Allow-transfer {none;};
QueryLog true;
Forwarders {10.19.98.45; 10.19.98.20;};
};
Zone "." in {
Type hint;
File "named.ca";
};
Zone "0.0.127.in-addr.arpa" in {
Type master;
File "Named.rev";
allow-update {none;};
};
Zone "localhost" in {
Type master;
File "Named.local";
allow-update {none;};
};
Zone "Baidu.com" in{
Type master;
File "Baidu.zone";
allow-update {none;};
};
Zone "100.19.10.in-addr.arpa" in {
Type master;
File "Baidu.rev";
allow-update {none;};
};
Zone "Www.126.com" in {
Type master;
File "126.zone";
allow-update {none;};
};
Zone "98.19.10.in-addr.arpa" in {
Type master;
File "126.rev";
allow-update {none;};
};
b) Forward parsing domain Baidu.zone$TTL 86400
$ORIGIN baidu.com.
@ in SOA baidu.com. Root.baidu.com. (
201112300;
3H;
15M;
1W;
1D);
@ in NS baidu.com.
In A 10.19.100.164
FTP in A 10.19.100.163
www in A 10.19.100.162
Feng in A 10.19.100.1
Mail in CNAME Fengc) Reverse parsing domain Baidu.rev$TTL 86400
@ in SOA baidu.com. Root.baidu.com. (
42;
3H;
15M;
1W;
1D);
@ in NS baidu.com.
164 in PTR baidu.com.
162 in PTR www.baidu.com.
163 in PTR ftp.baidu.com.
1 in PTR mail.baidu.com.

Quickly build a DNS server under Linux

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.