1. 程式人生 > 其它 >ic卡dump檔案內容解析_Centos 7.4 DNS域名解析

ic卡dump檔案內容解析_Centos 7.4 DNS域名解析

技術標籤:ic卡dump檔案內容解析

1、安裝部署包

yum -y install bind bind-utils bind-chroot

2、啟動服務並設定開機自啟動

[[email protected] ~]# systemctl start named.service[[email protected] ~]# systemctl enable named Created symlink from /etc/systemd/system/multi-user.target.wants/named.service to /usr/lib/systemd/system/named.service.

3、檢視服務是否啟動成功

[[email protected] ~]# ps -ef|grep named[[email protected] ~]# netstat -anntup|grep 53
28bfe7fa321a0bb16d8e6b8328ed2b69.png

4、修改主配置檔案

51574958ccb081fd74c3fca2634300a1.gif
vim /etc/named.conf...將下行中的127.0.0.1修改為any,代表允許監聽任何IP地址------------------------------修改前:options {    listen-on port 53 { 127.0.0.1; }; #修改    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     { localhost; };#修改-----------------------------------------修改後options {        listen-on port 53 { any; };        listen-on-v6 port 53 { any; };        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; };以下無需修改,但是需要了解,特此說明://此檔案內定義了全球13臺根DNS伺服器的IP地址zone "." IN {type hint;file "named.ca";};//此檔案儲存著正向與反向解析的區域資訊,非常的重要。include "/etc/named.rfc1912.zones";include "/etc/named.root.key";
51574958ccb081fd74c3fca2634300a1.gif

5、檢查語法看是否正確

[[email protected] ~]# named-checkconf 

6、修改區域配置檔案

  6.1配置檔案尾部追加

51574958ccb081fd74c3fca2634300a1.gif
vi /etc/named.rfc1912.zones尾部追加zone "wangzy.com" IN {        type master;        file "wangzy.com.zone";        allow-update { none; };};

zone "43.168.192.in-addr.arpa" IN { type master; file "named.192.168.43"; };

51574958ccb081fd74c3fca2634300a1.gif

  6.2 新增正向解析域

基於 name.localhost 模板,建立配置檔案

51574958ccb081fd74c3fca2634300a1.gif
[[email protected] ymyg]# cp -p /var/named/named.localhost /var/named/wangzy.com.zone[[email protected] ymyg]# vi /var/named/wangzy.com.zone$TTL [email protected]    IN SOA    @ rname.invalid. (                    0    ; serial                    1D    ; refresh                    1H    ; retry                    1W    ; expire                    3H )    ; minimum    NS    @    A    127.0.0.1    AAAA    ::1

ns IN A 192.168.43.13 www IN A 192.168.43.13

51574958ccb081fd74c3fca2634300a1.gif

說明:

http://www.wangzy.com 將會解析成192.168.43.13

授權 named 使用者

[[email protected] named]# chown :named /var/named/wangzy.com.zone

檢查區域配置檔案是否正確

[[email protected] named]# named-checkzone "wangzy.com" /var/named/wangzy.com.zone
 zone tx.ymyg/IN: loaded serial 0   OK

6.3 新增反向解析

修改區域配置檔案

51574958ccb081fd74c3fca2634300a1.gif
[[email protected] named]# cp named.localhost /var/named/named.192.168.43[[email protected] named]# vi named.192.168.43 $TTL [email protected]    IN SOA    @ rname.invalid. (                    0    ; serial                    1D    ; refresh                    1H    ; retry                    1W    ; expire                    3H )    ; minimum    NS    @    A    127.0.0.1    AAAA    ::113    PTR www.wangzy.com
51574958ccb081fd74c3fca2634300a1.gif

7、重啟服務

[[email protected] named]# systemctl restart named

使用nslookup測試

bind-utils 軟體包本身提供了測試工具 nslookup

yum -y install bind-utils

訪問測試前新增域名

[[email protected] named]# vi /etc/resolv.conf nameserver 192.168.43.13

測試:

51574958ccb081fd74c3fca2634300a1.gif
[[email protected] named]# nslookup www.wangzy.comServer:        192.168.43.13Address:    192.168.43.13#53Name:    www.wangzy.comAddress: 192.168.43.13[[email protected] named]# nslookup 192.168.43.13Server:        192.168.43.13Address:    192.168.43.13#5313.43.168.192.in-addr.arpa    name = www.wangzy.zone.43.168.192.in-addr.arpa.
51574958ccb081fd74c3fca2634300a1.gif 3838acc54ae553b70d9d0ea3cd64397b.png