Linux Service DNS

Source: Internet
Author: User
Tags mail exchange

Website Introduction

Www.benet.com (host name fqdn:full qualified domain name, fully qualified domainname)
There is a com,com domain below the domain that contains benet, and a host called www under the Benet domain.

Early parsing using hosts:

Configuration file/etc/hosts

IPAddr FQDN ailases
192.168.1.1 www.benet.com localhost
Hosts file disadvantages
The Hosts file needs to be filled in manually and cannot automatically get the new domain name
When the HTTP protocol began to be applied, the Internet domain name exploded, and the hosts file could not satisfy the parsing requirement.

DNS domain name resolution : Domail name Service

You can convert the FQDN to an IP address

You can also convert an IP address to an FQDN

ICANN:Maintenance of 13 root servers worldwide

Top-Level domains: Organizational domains:. com,. org,. NET,. cc
Country domain:. cn,. TW,. HK,. IQ,. IR,. JP

Second-level domain: Baidu Sina Sohu


Enquiry:
Recursion: Make a request straight
Iteration: Making multiple requests
The Internet query is two-paragraph: the client to the server request is recursive, the server query for the iteration

parsing:
Forward parsing: Fqdn<-->ip
Reverse parsing: Ip<-->fqdn

DNS Distributed Database
The superiors only know their direct subordinates.
Subordinates only know where the root is.

DNS-related types
Primary DNS server: Data modification
Secondary DNS server: Request data synchronization
Serial Number: Version
Refresh: Time period, define how long it takes to check
Retry: Retry time If the check is not reached within the specified time
Expire: Expiration time, after retrying or not checked, the primary server is considered to be hung.
Nagative Answer TTL
Cache DNS Server: not responsible for parsing, only responsible for providing authoritative answers
Forwarder: A server that forwards requests to a public network

DNS: Listening protocols and Ports
53/UDP: Client queries use
53/TCP: Synchronizing with the server

DNS record type :
SOA: Start authorization record
NS: Zone name to host name (group occurrence, one NS record and one a record)
A: Host name corresponds to IPV4 address
AAAA: Host name corresponds to IPV6 address
Ptr:ip Convert host Name
MX: Mail exchange records (need to be used with a record, MX records need to define priority)
CNAME: Alias Record

type of zone transfer:
Full zone transfer: Full transfer
Incremental zone transfer: Transfer only the changed content

Zone Type:
Primary zone: Master
From zone: Slave
Hint Area: hint
Forwarding Area: Forward

Bind Package:
Bind: Provides the main process of domain name service and related files
Bind-utils: Provides a test tool for DNS servers
Bind-libs: Provides library functions that bind and bind-utils need to use
Bind-chroot: Provides a spoofed root directory for the Bind service (Var/named/chroot folder as the root of bind) for increased security
Caching-nameserver: Provides a basic configuration file for building a cache server


Bind configuration file
/etc/named.conf Master configuration file


Cache server Configuration

options {        directory         "/var/named";}; zone  "."  IN {        type hint;         file  "named.ca";}; zone  "Localdomain"  IN {        type master;         file  "Localdomain.zone";         allow-update { none; };}; zone  "0.0.127.in-addr.arpa"  IN {        type  master;        file  "Named.local";         allow-update { none; };}; 


master server profile
" Span style= "FONT-SIZE:16PX;" > The primary server zone profile needs to have the NS record from the server
master server to add or delete records, you need to change the serial number from the server to synchronize

Options {directory "/var/named";}; Zone "."        in {type hint; File "named.ca";};        Zone "benet.com" in {type Master;        File "Benet.com.zone"; Allow-transfer {192.168.0.109;};};        Zone "0.168.192.in-addr.arpa" in {type Master;        File "192.168.1.arpa"; Allow-transfer {192.168.0.109;};};


Primary server forward zone configuration file

$TTL     86400@                IN SOA  localhost root  (                                          42               ; serial  (d. adams)                                            3H              ;  refresh                                          15M             ; retry                                           1W              ;  expiry                                          1D )              ; minimum                 in ns           ns1.benet.com.                 IN NS            NS2.benet.com.                 in mx  10       mail.benet.com.ns1              IN A             192.168.0.108ns2              IN A             192.168.0.109mail            in  A            192.168.0.10www              in a             192.168.0.20

master server Reverse Zone profile

$TTL     86400@                IN SOA  localhost root  (                                          42               ; serial  (d. adams)                                            3H              ;  refresh                                          15M             ; retry                                           1W              ;  expiry                                          1D )              ; minimum                 in ns           ns1.benet.com.                 IN NS            NS2.benet.com.108              IN PTR          NS1.benet.com.109              IN PTR           NS2.benet.com.10             IN PTR             Mail.benet.com.20             in ptr            www.benet.com.

From the server configuration file

Options {directory "/var/named";}; Zone "."        in {type hint; File "named.ca";};        Zone "benet.com" in {type slave;        File "Slaves/benet.com.zone"; Masters {192.168.0.108;};};        Zone "0.168.192.in-addr.arpa" in {type slave;        File "Slaves/192.168.1.arpa"; Masters {192.168.0.108;};};

Note: If not successful, the firewall may not be turned off

Iptables-f

Setenforce 0

DNS configuration file Syntax check

Check the master configuration file for syntax errors: named-checkconf
Check the master Profile zone configuration file for syntax errors: Service named Configtest


Set power on auto start:

Chkconfig named on

Dig parsing :
Dig-t record type name (@IP specify DNS lookup)
Dig-x IP lookup for domain names based on IP
Dig +trace-t A bbs.51cto.com @222.222.222.222//tracking how to parse the
DIG-T AXFR benet.com//View all configuration files for a zone

This article from "Plum blossom fragrance from bitter cold" blog, please be sure to keep this source http://wangjunkang.blog.51cto.com/8809812/1566083

Linux Service DNS

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.