Build a DNS server in Centos6 environment

Source: Internet
Author: User
Tags nslookup command
Configuration domain master server stage: 1. add the domain in the main configuration file of bind 2. create the zone file for this domain in/var/named. edit the zone file and add the required information. 4. detection firewall or selinux settings 5. start the bind service 6. run the host or nslookup command to check whether bindyumi is installed properly.

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 fileVim/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) orVim/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 rules 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 noChmod + 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.