一,安裝BIND
1.下載BIND http://www.isc.org 也可以去本站下載 bind9 dns軟件。 2.編譯安裝復制代碼 代碼如下:
# tar zxvf bind-9.4.0.tar.gz # cd bind-9.4.0 # ./configure sysconfdir=/etc //更多安裝選項 ./configure --help # make # make install二,配置BIND
A.創建需要文件 1)./etc/named.conf # vi /etc/named.conf 推出保存即可 或 touch /etc/named.conf2)./etc/rndc.conf # rndc-confgen > /etc/rndc.confB.創建目錄 /var/named
# mkdir /var/namedB.編輯/etc/named.conf 內容如下
復制代碼 代碼如下:
options { directory "/var/named"; //表示默認的數據庫文件在/var/named中 若沒有需手動創建 // pid-file "/var/run/named/named.pid"; //運行的PID文件路徑,用于使用其他用戶啟動named }; zone "." { //創建root域 type hint; file "named.ca"; }; zone "localhost" { //創建 localhost域 type master; file "named.local"; }; zone "example.com" { //創建 example.com域 type master; file "example.com.zone"; }; zone "0.0.127.in-addr.arpa"{ //localhost的反解析 type master; file "127.0.0.zone"; }; zone "100.168.192.in-addr.arpa" { //example.com的反向解析 type master; file "192.168.100.zone"; };//這段文件在/etc/rndc.conf 的尾部需拷貝才能使用 # tail +13 /etc/rndc.conf >>/etc/named.conf# Use with the following in named.conf, adjusting the allow list as needed: key "rndc-key" { algorithm hmac-md5; secret "HWM3L+e7LWDZJJ/dJEzQEw=="; }; controls { inet 127.0.0.1 port 953新聞熱點
疑難解答