DNS installation configuration full process _unix Linux

Source: Internet
Author: User
Tags mkdir
First download bind from http://download.chinaunix.net/download/0001000/6.shtml, I downloaded is bind-9.3.2.tar.gz

The files I downloaded are placed in the/OPT/SRC directory
Go to directory to decompress
[root@linux src] #tar zxvf bind-9.3.2.tar.gz
into a directory just extracted
[Root@linux src]# CD bind-9.3.2
Compiling configuration
[Root@linux bind-9.3.2]#./configure--prefix=/opt/app/named--enable-threads #--enable-threads to unlock multithreaded processing capabilities
[Root@linux bind-9.3.2] #make
[Root@linux bind-9.3.2] #make Install
Enter/opt/app/named to establish etc directory
[Root@linux bind-9.3.2] #cd/opt/app/named
[Root@linux named]# mkdir etc
Generate key file for RNDC control command
[Root@linux named]# Sbin/rndc-confgen > etc/rndc.conf
Extract key for named.conf from rndc.conf file
Root@linux named]# CD etc
[Root@linux etc]# tail-10 rndc.conf | head-9 | Sed s/#\//g > named.conf
Automatically generate named.conf files in/opt/app/named/etc
Create a zone file directory
[Root@linux etc]# mkdir/var/named
[Root@linux etc]# cd/var/named
Create a Localhost.zone file
[Root@linux named] #vi localhost.zone
$TTL 86400
$ORIGIN localhost.
@ 1D in SOA @ root (
42; Serial (d. Adams)
3H; Refresh
15M; Retry
1W; Expiry
1D); Minimum

1D in NS @
1D in A

Create a named.local file
[Root@linux named] #vi named.local
$TTL 86400
@ in SOA localhost. Root.localhost. (
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In NS localhost.

1 in PTR localhost.

Dig command to generate named.root files directly
[Root@linux named] #dig > Named.root
To establish a test.com domain name forward parsing file
[Root@linux named] #vi test.zone

$ttl 1D
@ in SOA test.com. Root.test.com. (


In NS test.com.
In MX 5 test.com.
www in A

Set up test.com domain name reverse parsing file
[Root@linux named] #vi test.local
$TTL 86400
@ in SOA test.com. Root.test.com. (
@ in NS test.com.
In PTR dns.test.com.

Configure named.conf like the following code

[Root@linux etc]# VI named.conf

Options {
Directory "/var/named"; #named区文件目录
Pid-file "Named.pid"; #进程id文件名
Controls {
inet allow {localhost;} keys {rndckey;};
Zone "." in {
Type hint;
File "Named.root";

Zone "localhost" in {
Type master;
File "Localhost.zone";
allow-update {none;};

Zone "0.0.127.in-addr.arpa" in {
Type master;
File "Named.local";
allow-update {none;};

Zone "test.com" in {
Type master;
File "Test.zone";
allow-update {none;};

Zone "19.202.220.in-addr.arpa" in {
Type master;
File "Test.local";
allow-update {none;};

Now it's configured to start bind.

Test DNS
[Root@linux etc]# host domain name pointer dns.test.com.
As shown above indicates that DNS reverse parsing is normal
[Root@linux etc]# Ping www.test.com
PING www.test.com ( bytes of data.
As shown above indicates positive parsing is normal
The DNS configuration is complete.

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.