Build separate domain name server resolution

Separating a .DNS resolve
the domain name server parses 1. The actual separation is still the primary domain name server, where said separation parsing (the DNS), mainly refers to DNS record to provide different depending on the client. Machine from a different address requests parsing the same domain name, to provide different analytical results.
2. For example, when the DNS server for the Internet and internal corporate LAN while providing a service that
you want to access the corporate LAN users domain name (www.kgc.com) data directly to the site is located within the network, mail servers, the gateway server to reduce the burden of address translation, as shown in Figure
Build separate domain name server resolution
II. experimental environment

device Claim ip address
A Linux computer as a domain name server Two network cards Public: 12.0.0.1 network: 192.168.10.1
Two pc Outside a simulated network within an analog network pc PC External network address: 12.0.0.12 network: 192.168.10.10

Three experimental procedure
1.yum -y install bind mounted
2. Create master configuration file (/etc/named.conf)
Options {
the listen-ON {Port 53 is the any ;}; // change the any
the listen-ON-V6 Port 53 is { . 1 ::;};
Directory "/ var / the named";
the dump-File "/var/named/data/cache_dump.db";
statistics-File "/var/named/data/named_stats.txt";
memstatistics-File " /var/named/data/named_mem_stats.txt ";
the allow-Query { the any ;}; // change the any
3. establishing regional profile (/ etcvim /etc/named.rfc1912.zones / named.)

view "lan" {// attempt disposed within the web facing the
match-clients {192.168.10.0/24;}; // matching conditions for the client from the network address

    zone "kgc.com" IN {
    type master;
    file "kgc.com.lan";              //指定面向内网用户的地址数据文件
    };

    zone "." IN {               //把主配置文件根域部分剪切到这边
    type hint;
    file "named.ca";
    };
    };

view "wan" {// set is provided for users outside the network
match-clients {12.0.0.0/24;}; // network address 12.0.0.0 matching conditions can be set to the any
Zone "kgc.com" {the IN
type Master;
file "kgc.com.wan"; // the specified location for the file outside the network database user
};

};

4. Establish zone configuration data files (files kgc.com.wan and establishing kgc.com.lan at / var / named directory)
kgc.com.lan document follows
$ the TTL 1D
@ the IN kgc.com the SOA. Admin.kgc .com (.
0; Serial
1D; Refresh
IH; the retry
1W; The expire
3H); Minimum
. kgc.com the NS
A 192.168.10.1
WWW the IN A 192.168.10.100
SMTP the IN A 192.168.10.111

kgc.con.wan document follows
$ the TTL 1D
@ the IN kgc.com admin.kgc.com the SOA.. (
0; Serial
1D; Refresh
IH; the retry
1W; The expire
3H); Minimum
the NS kgc.com.
A 12.0.0.1
12.0.0.1 the IN A WWW
SMTP the IN A 12.0.0.1
5. The closed STOP firewalld firewall systemctl
6. The boot service systemctl start bind

Guess you like

Origin blog.51cto.com/14449563/2435600
Recommended