Home  >  Article  >  php教程  >  Linux dns cache server and forward and reverse zone configuration

Linux dns cache server and forward and reverse zone configuration

高洛峰
高洛峰Original
2016-12-01 14:28:062962browse

dns cache server

Experimental machine ip 192.168.1.202

First:

1. yum install bind bind-libs bind-utils -y Download package installation

2. cp /etc/named.conf /etc/named .conf.bak Copy a configuration file

3. vim named.conf Enter the configuration file

(the red box is the place that needs to be added or modified)

Linux dns cache server and forward and reverse zone configuration

Then save and exit.

Linux dns cache server and forward and reverse zone configuration

Forward zone analysis:

vim /etc/named.rfc1912.zones Enter the file and add the following items

Linux dns cache server and forward and reverse zone configuration

2. Create a file lantern.com in the /var/named/ folder. zone

vim lantern.com.zone Enter the following items

Linux dns cache server and forward and reverse zone configuration

and check if there are any problems.

Linux dns cache server and forward and reverse zone configuration

It’s correct when you see the word OK.

Next, modify the permissions and group ownership of the lantern.com.zone file. Just modify it to be the same as other files

Linux dns cache server and forward and reverse zone configuration

Linux dns cache server and forward and reverse zone configuration

The next step is to restart the service.

Linux dns cache server and forward and reverse zone configuration

The above is all the preparation work. If it is correct, you can try it to see if it works. The picture below is polling. You can check it out. The following is query using NS and MX.

Linux dns cache server and forward and reverse zone configuration

Linux dns cache server and forward and reverse zone configurationThe above is the forward direction

The following is the reverse direction

Linux dns cache server and forward and reverse zone configurationvim /etc/named.rfc1912.zones After entering the file, you need to add the following items

Linux dns cache server and forward and reverse zone configuration

2. In /var Create a 192.168.1.zone file in /named/

vim 192.168.1.zone Add some content in it

Then save and exit. Then check the file for errors. Linux dns cache server and forward and reverse zone configuration

named-checkconf

named-checkzone “192.168.1.zone” /var/named/192.168.1.zone

If it is correct, the next step is to modify the permissions and group of this file

Linux dns cache server and forward and reverse zone configuration

Then restart the service

The following is the test

Linux dns cache server and forward and reverse zone configuration

Linux dns cache server and forward and reverse zone configurationThe above are all the experimental results.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn