1. 程式人生 > >LinuxDNS正向解析,域名轉換,郵件解析,反向解析,雙向解析

LinuxDNS正向解析,域名轉換,郵件解析,反向解析,雙向解析

8.更改/etc/named.conf主配置檔案,因為已經多了一個解析,一個本地解析,一個外網解析,所以此檔案也應隨之改變
改變內容為:
 50 /*
 51 zone "." IN {
 52         type hint;
 53         file "named.ca";
 54 };                                             50-57行隱掉
 55
 56 include "/etc/named.rfc1912.zones";
 57 */
 58 view localnet{                                    如果此處不會寫,可以通過命令man 5 named.conf,檢視如何去寫
 59        match-clients {1.1.1.0/24;};
 60         zone"." IN{                               58-65為本地解析
 61                 type hint;              
 62                 file "named.ca";                   
 63         };                                      
 64 include "/etc/named.rfc1912.inter";之所以此處為.inter不是.zone,是因為我將1.1.1網段作為了內網,如果要把172.25.75作為內網,那這裡就是.zone檔案。
 65 };
 66
 67 view internet{
 68        match-clients {any;};
 69         zone"." IN{                           67-74為外網解析,所以68行是any
 70                 type hint;
 71                 file "named.ca";
 72         };
 73 include "/etc/named.rfc1912.zones";
 74 };
 75 include "/etc/named.root.key";