Linux-centos7.4-dns II (Build a separate DNS server for resolution)

Source: Internet
Author: User
Tags nslookup nslookup command

Environment:
Linux Server one (dual NIC)
Intranet ip:192.168.80.180
External network ip:192.168.90.180
Linux client one, IP address: 192.168.80.10
Win7 client One, IP address: 192.168.90.10
Ensure network interoperability between server and two clients,
Server testing

Linux Client Testing

Win7 Client Testing

First step: Server Configuration
--------------1. Installation Service----------------
[[email protected] ~]# Yum install-y bind bind-utils//install DNS service with nslookup command
[[email protected] ~]# systemctl stop FIREWALLD//Turn off firewall
[[email protected] ~]# Setenforce 0//Turn off SELinux
-------------2. Edit the master configuration file---------------
[Email protected] ~]# vi/etc/named.conf
...............
Options {
Listen-on Port: (any;}; Listen to all addresses on the server
Listen-on-v6 Port 53 {:: 1;};
Directory "/var/named";
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";
allow-query {any;}; Allow all people to access
Skip to line 52 and delete the following four lines (delete the zone opening)
Zone "." in {
Type hint;
File "named.ca";
};
Save exit
[[email protected] ~]# named-checkconf//Check syntax error
---------------3. Edit the Zone profile----------------
[Email protected] ~]# Vi/etc/named.rfc1912.zones
Delete all zone openings (or add a view configuration above each)
Add the following content:
View "LAN" {//config Intranet
match-clients {192.168.80.0/24;};
Zone "Hello.com" in {
Type master;
File "Hello.com.zone.lan";
};
};
View "WAN" {//Configure Extranet
match-clients {any;};
Zone "Hello.com" in {
Type master;
File "Hello.com.zone.wan";
};
};
Save exit
[[email protected] ~]# named-checkconf//Check syntax error
----------4. Edit the Zone data profile------------
[Email protected] ~]# cd/var/named
[[email protected] named]# cp-p named.localhost Hello.com.zone.lan//Create Intranet Zone data profile
[[email protected] named]# cp-p named.localhost Hello.com.zone.wan//Create an Extranet zone data profile
[[Email protected] named]# VI Hello.com.zone.lan//Edit Intranet area data profile
Modify the following configuration:
$TTL 1D
@ in SOA @ rname.invalid. (
0; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
NS @
A 192.168.80.180//native address
www in A 192.168.80.180//www.hello.com corresponding address
Save exit
[[Email protected] named]# VI Hello.com.zone.wan//Edit extranet Zone Data profile
Modify the following configuration:
$TTL 1D
@ in SOA @ rname.invalid. (
0; Serial
1D; Refresh
1H; Retry
1W; Expire
3H); Minimum
NS @
A 192.168.90.180//native address
www in A 192.168.90.180//www.hello.com corresponding address
Save exit
[[email protected] named]# named-checkconf//Check syntax
----------5. Start the service----------------
[[email protected] named]# systemctl start named//Start DNS Service
[Email protected] named]# Netstat-anpu | grep named//view DNS service status
Show

Step Two: Client testing
---------1.linux Client Test-----------
[[email protected] ~]# systemctl stop FIREWALLD//Turn off firewall
[[email protected] ~]# Setenforce 0//Turn off SELinux
[[email protected] ~]# vi/etc/resolv.conf//Configure DNS
Add domain Name: (all other delete)
NameServer 192.168.80.180
Save exit
[email protected] ~]# nslookup www.hello.com//parsing www.hello.com

Successful parsing
---------2.win7 Client Test----------
Shutting down the firewall
Add DNS to 192.168.90.180,

Parse www.hello.com,

Parse success

Linux-centos7.4-dns II (Build a separate DNS server for resolution)

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.