Bind slave server and Cache Server Configuration

Source: Internet
Author: User
Tags domain server

It is often not enough to have only one master server in the production environment.
The slave server of a domain is usually used for backup and load balancing.
All the information about these domains is controlled by the domain master server.
The domain server does not have the permission to create or modify the zone file of the domain. Instead, it captures the zone file of the domain from the domain master server.

Domain slave server configuration steps:

① Add the domain definition in the main configuration file of bind
② Start the bind service or make the BIND refresh the configuration
③ Check whether the zone file of the domain is normally crawled to the/var/named/slaves directory.
④ Use the host or dig command to check whether the domain information is normal

Master/Slave DNS Server Extension diagram:

(I) -- Preparation

[Root @ localhost ~] # Service named start
Start named: [OK]
[Root @ localhost ~] # Iptables-f -- check firewall settings
[Root @ localhost ~] # Getenforce -- check SELinux settings
Disabled
[Root @ localhost etc] # pwd
/Var/named/chroot/etc
[Root @ localhost etc] # Vim named. conf
-- Delete the Listener Configuration below
Listen-on port 53 {127.0.0.1 ;};
-- Otherwise, bind only serves the local machine, but slave is connected from the Internet


(II) -- log on to the slave server
-- Add the configuration information from example.com to the main configuration file of BIND:
Configuration File Location:
/Var/named/chroot/etc/named. conf
Add a zone definition for a single domain in the main configuration file:

Zone "example.com" {type slave; Masters {192.168.1.110 ;}; -- there must be a space between the semicolon and braces! File "Slaves/example.com. Zone ";};

(3) -- check the read and write permissions of named on slaves files
Slaves file location:
/Var/named/chroot/var/named
It is best to change the user and group to named.

[Root @ localhost named] # chown named slaves/
[Root @ localhost named] # ls-l
Total 44
..
..
Drwxrwx --- 2 named 4096 12-01 slaves

(Iv) -- restart the bind Service

[Root @ localhost etc] # service named restart
Stop named: [OK]
Start named: [OK]

(V) -- check whether the zone file is properly captured
File Location:
/Var/named/chroot/var/named/slaves
[Root @ localhost slaves] # ls
Example.com. Zone My. ddns. Internal. Zone. DB my. Slave. Internal. Zone. DB

(6) -- verify whether the slave Server Bind can run normally
-- Test by pointing the local DNS configuration to the Local Machine

[Root @ localhost slaves] # Vim/etc/resolv. conf
Nameserver 127.0.0.1
[Root @ localhost slaves] # host www.example.com
Www.example.com has address 192.168.1.130
It can be seen that the slave Server Bind can serve normally
So far, the slave server has been set up

 

 

A Lan may have many hosts accessing the Internet. In this case, you can configure a cache server at the LAN exit to accelerate network access.
You can also configure an upstream DNS server address for the cache server.
That is, when the cache server cannot complete resolution or users in the LAN want to access additional DNS servers except the specified DNS configuration
The client will return a more stable or more comprehensive DNS address.
The client can continue the query through this DNS

Configure on the master:

File Location:
/Var/named/chroot/etc

[root@localhost etc]# vim named.confoptions{                directory "/var/named";        forwarders {222.1.33.6; }; };

If we specify forward only in named. conf
The cache server does not perform any resolution queries.
Forward requests directly to the upstream DNS Server

options{                directory "/var/named";        forwarders {222.1.33.6; };        forward only; };

 

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.