DNS (ii) Forward and backward parsing configuration and client query tools for Linux

Source: Internet
Author: User
Tags nslookup

First, the service installation:

1 , Bind Introduction:

Bind : Berkeley Internet Name Domain

www.isc.org


Package:

Bind : Bind application packages;

bind-utils : Client toolkit;


Service Program Name: named


2 , program installation:

# Yum Install bind: Installing bind;# rpm–ql Bind | Less: View the bind installation build file;


#/etc/rc.d/init.d/named: Service startup script; #/etc/named.conf: Service master profile; #/etc/named.rfc1912.zones: zone configuration file;


Second, the service configuration:

1 , master configuration file:

# vim /etc/named.conf> options    {    //Global Configuration;>      listen-on port53 { 127.0.0.1; };    // Listening port and IP, default to native only, note can listen to all IP port number 53rd;>     listen-on-v6port 53 { ::1;  };    //Note to listen for all IPV6 port 53rd;>     directory  "/var/ Named ";     //indicates the Zone profile directory;>     allow-query {  localhost; };    //access control, annotations allow all ip>     recursion  yes;    //whether recursive > };>> logging {    //configuration log information; > };>> zone  "."  in {    //Configuring the root zone;> };>> include  "/etc/ Named.rfc1912.zones ";     //read the domain file information;> include "/etc/named.root.key ";    &nbSP;//is related to remote control; 

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/0B/wKioL1WweJziZzKHAAGvE-s4RMs958.jpg "title=" 2-1. JPG "alt=" wkiol1wwejzizzkhaagve-s4rms958.jpg "/>



2 , zone configuration file:

# Vim/etc/named.rfc1912.zones: Add forward parsing region and reverse parsing region;


Forward parsing:

> Zone "chencer.org" in {> type master;    Indicates the parsing type (master|slave|hint|forward);> file "Chencer.org.zone"; Indicates the parse file, which is the relative path, which is the directory defined in the master configuration file/var/named/;>};

Reverse parsing:

> Zone "1.168.192.in-addr.arpa" in {> type master;> file "1.168.192.in-addr.arpa.zone";>};


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/0F/wKiom1Wwd4PDY4QgAABc-jWkBv8786.jpg "title=" 2-2. JPG "alt=" wkiom1wwd4pdy4qgaabc-jwkbv8786.jpg "/>


3 , providing a parse library:

Forward Parsing Library:

# vim /var/named/chencer.org.zone>  $TTL  86400> @    in     soa    dns.chencer.org.    root.chencer.org.      (>     2015072201>     1D>      10m>     5d>     1d     ) > @      IN    NS     dns> @      IN    MX     10    mail> dns    in    a     192.168.1.10> www    IN    A     192.168.1.11> blog   IN    A     192.168.1.12> pop3   in    a    192.168.1.13> web     In    cname    www


Reverse Parse Library:

# vim /var/named/1.168.192.in-addr.arpa.zone>  $TTL  86400> @     IN    SOA    dns.chencer.org.     root.chencer.org.     (>     2015072201>      1D>     10M>     5D>      1D    ) > @     in    ns     dns.chencer.org.> 10    in    ptr     dns.chencer.org.> 11    in    ptr     www.chencer.org.> 12    in    ptr     blog.chencer.org.> 13    in    ptr     pop3.chencer.org.

Description

1, forward parsing and reverse parsing the names in the file can use only relative names, which are relative to the current region;

2, the absolute suffix can use $ORIGIN to define;

Modify the Parse library file group and permissions:

# chown root:named/var/named/chencer.org.zone# chown root:named/var/named/1.168.192.in-addr.arpa.zone# chmod 640/var /named/chencer.org.zone# chmod 640/var/named/1.168.192.in-addr.arpa.zone

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/0F/wKiom1WweTPjjI-XAAFvRx7hbI0686.jpg "title=" 2-3. JPG "alt=" wkiom1wwetpjji-xaafvrx7hbi0686.jpg "/>


Third, start the service:

# Service named Configtest: Check the configuration file syntax is wrong; # chkconfig named on: Set boot boot; # service named {Start|restart}: Start or restart the service; SS-TUNL | grep:53: View port 53rd for TCP and UDP, # RNDC Reload: Service needs to reload after the configuration file is modified in service startup;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/0F/wKiom1WweY3z-Mc9AAF0riHPldY369.jpg "title=" 2-4. JPG "alt=" wkiom1wwey3z-mc9aaf0rihpldy369.jpg "/>650) this.width=650; src=" Http://s3.51cto.com/wyfs02/M01/70/0C /wkiol1wwe4lqerr8aabkumnv7uu174.jpg "title=" 2-5.jpg "alt=" Wkiol1wwe4lqerr8aabkumnv7uu174.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/0C/wKioL1Wwe5LTjCE1AAE2C6UT4fA515.jpg "title=" 2-6. JPG "alt=" wkiol1wwe5ltjce1aae2c6ut4fa515.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/0F/wKiom1WwebuwHwb5AACJBGCIneM779.jpg "title=" 2-7. JPG "alt=" wkiom1wwebuwhwb5aacjbgcinem779.jpg "/>


Four, the client query tool;

# yum Install Bind-utils: The client needs to install the query tool package;


1 , Host :

# host-t Rrtype NAME [SERVER]-T rrtype: Specifies the resource record type (a| ns| soa| Mx| PRT); Name:ip or FQDN; server: Specify a DNS server;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/0C/wKioL1Wwe_KAF603AAI4Kf5Gftk048.jpg "title=" 2-8. JPG "alt=" wkiol1wwe_kaf603aai4kf5gftk048.jpg "/>


2 , nslookup :

Interactive query tool:

# nslookup> Server ip:> set type={a| soa| ns| Mx}> NAME

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/0C/wKioL1WwfBPA9Ws_AAF5enXovo8328.jpg "title=" 2-9. JPG "alt=" wkiol1wwfbpa9ws_aaf5enxovo8328.jpg "/>


3 , Dig :

# dig-t TYPE NAME @SERVER query option: +trace +notrace +recurse +norecurse


Forward parsing:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/0F/wKiom1WwemTy7Rx-AAHZqX1VBMY621.jpg "title=" 2-10. JPG "alt=" wkiom1wwemty7rx-aahzqx1vbmy621.jpg "/>


The test inverse does not use- t PTR, and the -x option is used ;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/0F/wKiom1Wwen-SZJlQAAHP_vp0JR8253.jpg "title=" 2-11. JPG "alt=" wkiom1wwen-szjlqaahp_vp0jr8253.jpg "/>

This article is from the "Pony Learning Record" blog, make sure to keep this source http://masachencer.blog.51cto.com/8683770/1677504

DNS (ii) Forward and backward parsing configuration and client query tools for Linux

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.