溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

DNS 正反向解析

發(fā)布時間:2020-07-31 07:29:55 來源:網(wǎng)絡 閱讀:380 作者:何去何從_ie 欄目:云計算

yum install bind -y #安裝dns服務

vi /etc/named.conf    #進入dns配置文件修改以下內(nèi)容
listen-on port 53 { any; };
allow-query     { any; };  

DNS 正反向解析

vi /etc/named.rfc1912.zones:         
到最后一行添加以下內(nèi)容

zone "hello.com" IN {      //正向解析
      type master;
      file "hello.zone";
};
zone "80.168.192.in-addr.arpa" IN {    //反向解析
        type master;
        file "hello.local";
};
cd /var/named
cp -p named.localhost hello.zone  //正向解析模板
vi  hello.zone

$TTL 1D
@       IN SOA  hello.zone 3040401509@qq.com (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      dns.hello.com.
dns     IN A    192.168.80.100
www     IN A    192.168.80.101
ftp     IN A    192.168.80.102

cp -p named.localhost hello.local //反向解析模板

vi hello.local

$TTL 1D
@ IN SOA hello. 3040401509@qq.com (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS dns.hello.com.
100 IN PTR dns.hello.com.
101 IN PTR www.hello.com.

檢查主配置文件語法是否有錯誤:
named-checkconf

systemctl start named 啟動服務

netstat -anpt | grep named


![](https://s1.51cto.com/images/blog/201904/04/b7b30a20bf2b8cd096c57af923b861c4.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)

vi /etc/sysconfig/network-scripts/ifcfg-ens32

DNS1=192.168.80.100



![](https://s1.51cto.com/images/blog/201904/04/77efd6b912f0ba5637c59ac6dafe6034.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)

> systemctl restart network
> nslookup www.hello.com

![](https://s1.51cto.com/images/blog/201904/04/3ce4a31281a70ac11e5590dfc4dc1826.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)

> nslookup 192.168.80.100

![](https://s1.51cto.com/images/blog/201904/04/c775ec6022840c0f461b9bc026014973.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI