Configure DNS service with BIND under CentOS

Source: Internet
Author: User
Tags nslookup



I. INTRODUCTION of DNS

Second, bind installation

Third, bind configuration

Iv. bind Check configuration file

V. Verification

Vi. Common Mistakes

Seven, to be sorted





I. INTRODUCTION of DNS

DNS (domain Name Service), name resolution service.

History:

1, the early computer compared to the people by creating changes to the Hosts file on their own computer to achieve IP and domain name corresponding relationship.

2, for unified management, faster update to the latest HOSTS file, people unified to an FTP server to download the Hosts file.

3, when the computer explosive growth, through the unified to the FTP server download update Hosts file is not realistic, resulting in a multi-level domain to manage domain names. The parent domain is only responsible for the subordinate domain authorization.


Domain Name Type:

"Root domain"

.

"Primary domain/top-level domain"

organizational domain, business organization domain:com, com.cn, org, gov, edu, net

country domain:cn, HK, TW, JP, KR, IR, IQ, my, US, UK, RU, JP

reverse domain:in-addr-arpa

"Level two domain"

Baidu.com sina.com.cn, CN 163.com


Example: (This ignores the TTL description) The DNS server set by user 202.96.128.1 is: 8.8.8.8, which obtains the IP address of tieba.baidu.com. The process is as follows: 1, 202.96.128.1 first query the local have no query cache, if not the DNS server query. 2, the DNS server 8.8.8.8 information, so it does not directly return the tieba.baidu.com IP, but tells the DNS server 8.8.8.8: "com. The address is 1.1.1.1, you go to find it query it." "4, 8.8.8.8 to COM inquiry. In the same vein, the COM. domain does not hold tieba.baidu.com IP, it returns information to the DNS server 8.8.8.8: "Baidu.com. The address is 10.10.10.10, you go to find it query it. "5, the DNS server 8.8.8.8 to baidu.com at this time. Query the address of tieba.baidu.com, Baidu.com will return tieba.baidu.com. ip:12.12.12.12 to the DNS server. 6, the DNS server receives the query results will be cached to facilitate the user later query, and return the query results to the user 202.96.128.1.



Second, bind installation

Bind (Berkeley Internet Name Domain)

Using Yum installation in CentOS: Yum install bind bind-utils bind-libs portreserve

Portreserve I don't know what it is, dependencies installed it bind-libs bind to use the library bind-utils some tools, nslookup,host,dig and so bind is the domain name resolution installation package


Third, bind configuration

# vim /etc/named.conf    #  Modify the listening address and allow query configuration         listen-on port 53 { 192.168.86.16; };   // Set bind listener in 192.168.86.16:53        allow-query     The  { 192.168.86.0/24; };  //setting allows the 192.168.86.0 network segment to be set as a DNS server to query # vim /etc/ named.rfc1912.zones    #  add contoso.com domain and reverse parse 192.168.86.arpazone  "contoso.com"  IN {        type master;         file  "contoso.com";     //filename must correspond to the zone file created later (/var/named/)          allow-update { none; };}; zone  "86.168.192.in-addr.arpa"  IN {        type  master;        file  "192.168.86.arpa ";  //filename must correspond to the zone file created later (/var/named/)          allow-update { none; }; };


# vim/var/named/contoso.com

$TTL 1800

@in SOAcontoso.com. Admin.contoso.com. (

0; Serial

1D; Refresh

1H; Retry

1W; Expire

3H); Minimum

@inNSlinuxdns.contoso.com.

LinuxdnsinA192.168.86.16

DC01inA192.168.86.1

DC02inA192.168.86.2

*inA192.168.86.12


# Vim/var/named/192.168.86.arpa

$TTL 1800

@in SOAcontoso.com. Admin.contoso.com. (

0; Serial

1D; Refresh

1H; Retry

1W; Expire

3H); Minimum

@inNSlinuxdns.contoso.com.

inPTRlinuxdns.contoso.com.

1inPTRdc01.contoso.com.

2inPTRdc02.contoso.com.


# chown Named.named/var/named/192.168.86.arpa/var/named/contoso.com

#/etc/init.d/named Start


Iv. bind Check configuration file

# named-checkconf/etc/named.conf

# Named-checkconf/etc/named.rfc1912.zones

# Named-checkzone Contoso.com/var/named/contoso.com



V. Verification

Nslookup linuxdns.contoso.com 192.168.86.16

Nslookup dc01.contoso.com 192.168.86.16

Nslookup dc02.contoso.com 192.168.86.16

Dig linuxdns.contoso.com @192.168.86.16


Vi. Common Error Troubleshooting


1, bind configuration file, Allow-query, listen-on,

2, zone file format and permissions (named need to have read permissions to the file) # Chown-r named.named/var/named/

3, Iptables (open 53 port) # Iptables-f

4, SELinux (generally set to permissive or disabled) # Setenforce 0




Vii. to be sorted and updated





















This article is from the "Do not forget Beginner's mind" blog, please be sure to keep this source http://winterysea.blog.51cto.com/9677346/1679834

Configure DNS service with BIND under CentOS

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.