Set up DNS service in linux

Source: Internet
Author: User
All required software bind-9.4.2.tar.gz // required

A required software
Bind-9.4.2.tar.gz // http://www.isc.org/
Wget http://ftp.isc.org/isc/bind9/9.4.2/bind-9.4.2.tar.gz

2. unzip and install
# Tar zxvf bind-9.4.2.tar.gz
# Cd bind-9.4.2
#./Configure -- sysconfdir =/etc
# Make
# Make install

Three main configuration files
# Vim/etc/named. conf
Options {
Directory "/var/named ";
};

Zone "."{
Type hint;
File "named. ca ";
};

Create a configuration Directory
# Mkdir/var/named

Generate the named. ca file
1 configure DNS
# Echo "nameserver 202.99.192.68">/etc/resolv. conf

2. use the DNS mining tool to view the root
# Dig-t NS.

3 generate the named. ca file
# Dig-t NS.>/var/named. ca

4. use RNDC to control servers
Produce rndc configuration file
# Rndc-confgen>/etc/rndc. conf

Show row number
# Cat-n/etc/rndc. conf

Append from line 13 to the end to the named. conf file
# Tail + 13/etc/rndc. conf>/etc/named. conf

Remove the newly added comment
# Vim/etc/named. conf

5. run and test
Run DNS
# Named

Check status
# Rndc status

Configure DNS
# Echo "nameserver 127.0.0.1">/etc/resolv. conf

Test
# Host www.163.com

6. add local and other
# Vim/etc/named. conf

Zone "localhost "{
Type master;
File "named. local ";
};

Zone "test.com "{
Type master;
File "test.com. zone ";
};

# Vim/var/named. local
@ In soa localhost. root (
2008010201; serial
1 H; refresh
15 M; retry
1 W; expire
1D); TTL
In ns @
In a 127.0.0.1

# Vim/var/named/test.com. zone
@ In soa test.com. root (
2008010201; serial
1 H; refresh
15 M; retry
1 W; expire
1D); TTL
In ns ns
In mx 10 mail
Ns in a 10.0.0.8
Www in a 10.0.0.167
Mail in a 10.0.0.168
News in cname www

Reload
# Rndc reload

Seven reverse zones
...

From: wl315 blog

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.