您好,登錄后才能下訂單哦!
1.安裝bind軟件包
yum?install?-y?bind*
2.各配置文件路徑索引
/etc/named.conf?#主配置文件 /var/named/?#解析數據庫文件目錄 /etc/named.rfc1912.zones?#默認的解析區域文件
3.主配置文件的修改
#以下修改只是我做改動的地方? vim?/etc/named.conf? options?{ ??????? #listen-on?port?53?{?127.0.0.1;?};?注釋掉該行表示在所有接口IP啟用53端口的監聽 ??????? #listen-on-v6?port?53?{?::1;?};?關閉IPv6的監聽 ??????? ?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"; ??????? ?recursing-file??"/var/named/data/named.recursing"; ???????? secroots-file???"/var/named/data/named.secroots"; ???????? #allow-query?????{?localhost;?};?允許所有主機進行DNS查詢,默認只允許本地查詢? zone?"example.com"?IN?{? type?master;?? file?"example.com.zone";?#如果不加絕對路徑的話,默認會將配置文件認為是在/var/named目錄內 ?};????????? #include?"/etc/named.rfc1912.zones";?注釋掉該行 include?"/etc/named.root.key";
4.創建數據庫文件
cd?/var/named/? cp?named.localhost?example.com.zone?#通過默認的區域文件創建一個 vim?example.com.zone? $TTL?1D @IN?SOAexample.com?dns.example.com.? ?????????????????????????????????????????????????( 0;?serial? ?????????????????????????????????????????????????1D;?refresh ?????????????????????????????????????????????????1H;?retry? ?????????????????????????????????????????????????1W;?expire? ?????????????????????????????????????????????????3H?);?minimum? @????????INNSdns.example.com.? dnsINA172.16.104.123 wwwINA172.16.104.123
5.重啟測試
systemctl?restart?named [root@localhost?named]#?systemctl?status?named?#查看一下狀態? cat?/etc/resolv.conf?#確定DNS地址? #?Generated?by?NetworkManager? nameserver?172.16.104.123??????????? [root@localhost?~]#?nslookup?www.example.com? Server:172.16.104.123? Address:172.16.104.123#53? Name:www.example.com? Address:?172.16.104.123
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。