DNS server configuration Full process

Source: Internet
Author: User
Tags bind mkdir root directory linux

First download BIND from http://www.isc.org/products/BIND/, I downloaded is bind-9.3.1rc1.tar.gz

The files I downloaded are placed in the/root directory
Go to directory to decompress
[Root@linux Root] #tar XFZ bind-9.3.1rc1.tar.gz
into a directory just extracted
[Root@linux root]# CD Bind-9.3.1rc1
Compiling configuration
[Root@linux bind-9.3.1rc1]#./configure--prefix=/usr/local/named--enable-threads #--enable-threads to unlock multithreaded processing capabilities
[Root@linux Bind-9.3.1rc1] #make
[Root@linux Bind-9.3.1rc1] #make Install
Enter/usr/local/named to establish etc directory
[Root@linux Bind-9.3.1rc1] #cd/usr/local/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/usr/local/named/etc
Create a zone file directory
[Root@linux etc]# mkdir/var/named
Enter/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 127.0.0.1

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

1053891162
3H

15M
1W
1D)

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

Set up test.com domain name reverse parsing file
[Root@linux named] #vi test.local
$TTL 86400
@ in SOA test.com. Root.test.com. (
20031001;
7200;
3600;
43200;
86400);
@ 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 127.0.0.1 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.

/usr/local/named/sbin/named-c/usr/local/named/etc/named.conf &

Just Show
Runing indicates successful operation
Test DNS
[Root@linux etc]# host 220202.19.82
89.19.202.220.IN-ADDR.ARPA 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 (220.202.19.82) 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.