CentOS 6.5 DNS Server Setup

Source: Internet
Author: User

Brief steps:

1. Add the domain in the main configuration file of bind

2. Create a zone file for the domain in/var/named

3. Edit the zone file to add the required information

4. Detect firewall or SELinux settings

5. Start the BIND service and restart the network service

6. Client-side test domain name resolution


1. Installing the DNS server components

Install bind

Yum-y Install bind bind-chroot bind-util bind-libs

2. Edit the DNS master configuration file

vi/etc/named.conf Modify the master configuration file, such as:

Edit complete, save exit

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/84/17/wKioL1eFptOB5c4KAABST7VsWsY491.png "title=" 1.png " alt= "Wkiol1efptob5c4kaabst7vswsy491.png"/>


3, then modify the Named.rfc1912.zones file, Vi/etc/named.rfc1912.zones, such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/84/17/wKioL1eFpu_CnzNoAABaiinoDlI966.png "title=" 2.png " alt= "Wkiol1efpu_cnznoaabaiinodli966.png"/>


4. Add set DNS forward parsing

Modify zone configuration file, forward parsing:

#cd/var/named/

#cp Named.localhost soundmobii.com

#vi soundmobii.com (same as the zone file name defined in the main profile [/etc/named.rfc1912.zones])


$TTL 1D

@ in SOA @ ns.soundmobii.com. (

0; Serial

1D; Refresh

1H; Retry

1W; Expire

3H); Minimum

@ in NS ns.soundmobii.com.

NS in A 192.168.2.98

Tomcat in CNAME NS


5, modify the zone configuration file, reverse parsing:

#cd/var/named/

#cp Named.localhost 2.168.192.in-addr.arpa

#vi 2.168.192.in-addr.arpa (to match the zone file name defined in the main configuration [/etc/named.rfc1912.zones] file)


$TTL 1D

@ in SOA @ ns.soundmobii.com. (

0; Serial

1D; Refresh

1H; Retry

1W; Expire

3H); Minimum

@ NS ns.soundmobii.com.

98 in PTR ns.soundmobii.com.



6. Change firewall settings and SELinux settings

Getenforce (see if SELinux is turned on)

Setenforce 0

Vi/etc/sysconfig/iptables #配置防火墙端口

-ainput-m State--state new-m tcp-p TCP--dport 53-j ACCEPT

-ainput-m State--state new-m udp-p UDP--dport 53-j ACCEPT

-ainput-m State--state new-m tcp-p TCP--dport 953-j ACCEPT

Service iptables Restart #重启防火墙 to make the rules effective


7. Start the DNS service (note that the DNS services name is called bind in Linux)

Service named start


8, test the detection domain information is normal (important)

Check to see if the configuration file has Read permission before checking ll/var/named

(if not read full line, chmod +r/var/named/* can)

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/84/18/wKiom1eFpzqBVtAaAABcJG_6mlQ529.png "title=" 3.png " alt= "Wkiom1efpzqbvtaaaabcjg_6mlq529.png"/>


9, check the bind file configuration process error prone

The following commands are used to check the bind configuration file and zone file syntax

Named-checkconf/etc/named.conf

Named-checkzone soundmobii.com/var/named/soundmobii.com

10

10. Start the restart DNS service to view service status

Service named restart

Service Network restart

User-side test parsing, test through Nslookup.


This article is from the "Chen blog" blog, make sure to keep this source http://chenshengang.blog.51cto.com/4399161/1825964

CentOS 6.5 DNS Server Setup

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.