How to build a DNS server in Linux

Source: Internet
Author: User
Tags to domain

How to build a DNS server in Linux

DNS is short for Domain Name System. It is a mechanism that converts an IP address to a host name or a host name to a corresponding IP address. The IP address resolved through the domain name is called forward resolution, and the domain name is called reverse resolution through IP Address Resolution. DNS record type: A: Address domain name to IP address conversion record; PTR: printer IP address to domain name conversion record; NS: represents the domain's DNS server; mx: indicates the email server in the domain; cname: the alias of the domain name; SOA: Start of Authority indicates the primary DNS server in the domain. Software that provides DNS services: bind, that is, Berkeley Internet Name Domain, is developed by the University of California at Berkeley and is the most widely used software that provides DNS services. Next let's go to the question: DNS Cache Server, Master/Slave server, subdomain authorization, forwarding, and view configuration steps.
DNS Cache Server

PS: in order to better understand and understand the DNS configuration file and domain resolution file, the author only installs the Bind package here and generates these required files by manual editing.

1. Install the Bind package

yum install bind 

 

2. Create the configuration file/etc/named. conf.

Create the configuration file named under the/var/named/chroot/etc directory. conf the domain name to be resolved here is: www.topq.com the specific content is as follows: Options {directory "/var/named"; # inform working directory }; zone "topq.com" in {# type Master defined by the local positive solution; # type: Master File "topq.com. zone "; # The directory where the forward solution file name is located:/var/named/chroot/var/namedallow-update {none ;}; zone" 0.168.192.in-ADDR. ARPA "in {# define the type master for local reverse decoding; file" 0.168.192.in-ADDR. local "; # Reverse Solution file name allow-update {none ;};}; chown named: Named/var/named/chroot/etc/named. conf # modify the group to named # ls-ALH-RW-r -- 1 named 232 03-16 named. conf

3. Create two parsing files

Forward parsing: Create the file topq.com in the/var/named/chroot/var/named directory. zone Vim topq.com. zone $ TTL 86400 # default TTL value @ in SOA localhost root (# Master DNS server localhost. 2013031601 # Time + Serial number 01 1 h # refresh time: how long will the master query update 10 m # Retry Interval 7d # expiration time, if the master still cannot be found 7 days, slave stops service 1D # It takes time to deny the answer TTL value, indicating that the query fails again.) In NS dns.topq.com. # dns.topq.com. in a 192.168.2.213 # reverse resolution of local ipwww.topq.com in a 192.168.2.213: create a file in the/var/named/chroot/var/named directory: 0.168.192.in-ADDR. Local Vim 0.168.192.in-ADDR. Local is not finished. Save the reserved value first...

4. Check the Configuration File Syntax

named-checkconf

5. Enable and test the service

Service named startnslookup www.topq.com # Test Positive Solution

NSLookup 192.168.2.213 # test Reverse Solution

 

 

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.