Build a DNS server in Centos6 Environment

Source: Internet
Author: User
Tags nslookup nslookup command

Build a DNS server in Centos6 Environment

Configure the domain master server

Phase:

1. Add the domain to the bind main configuration file

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

3. Edit the zone file and add the required information.

4. check firewall or selinux settings

5. Start the bind Service

6. Run the host or nslookup command to check whether the domain information is normal.

Install bind

Yum install-y bind-chroot bind-utils


The BIND configuration file is saved in:

/Etc/named. conf main configuration file

/Var/named/domain zone File Location

Modify the main configuration file

Vim/etc/named. conf (for example, 1)

After modification, save and exit.

Configure the zone File

Modify the zone configuration file vim/etc/named. rfc1912.zones (for example, 2)


Configure forward resolution (e.g)

Cd/var/named/

Cp named. localhost helome.com. zone

Vim helome.com. zone (it must be consistent with the zone file name defined in the main configuration file)

Configure reverse resolution (for example, 2)

Cp named. localhost 32.16192.zone

Vim 32.16192.zone

Save and exit!


Change firewall settings and selinux settings

Getenforce

Setenforce 0

Iptables-F (as shown in) or vim/etc/sysconfig/iptables # configure the firewall port (as shown in figure 2)

-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 save

Service iptables restart # restart the firewall to make the rule take effect


Start bind

Service named start

Modify the/etc/resolv. conf file

Vim/etc/resolv. conf


Test whether domain information is normal

Check whether the configuration file has the read permission ll/var/named (if there is no chmod + r/var/named)


Use the host or nslookup command to check whether the domain information is normal, as shown in)

Host mail.helome.com

Nslookup mail.helome.com

The establishment of the DNS server is complete.


Error-prone during bind file configuration

Run the following command to check the bind configuration file and zone File Syntax:

Named-checkconf/etc/named. conf

Named-checkzone helome.com/var/named/helome.com. zone


Check whether the configuration file has read permission.

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.