文档详情

配置Dns服务器Linux.doc

发布:2018-06-30约2.32千字共4页下载文档
文本预览下载声明
配置 DNS 伺服器 對於用於網路快速更新的軟體各版本,用對外開放的伺服器來測試是具有一定危險性的,用內部網專門的一台電腦來測試是最好不過的了,因此就專門配置了一台用於內聯網的伺服器,也因此配置了一個爲內聯網用的簡單 DNS 伺服器,下面就介紹一下這個 DNS 的配置過程. 內聯網主機伺服器的主機名爲 pc10,IP 是:0,啓用 tcpip.cxm 作爲功能變數名稱. 整個過程需要配置以下幾個配置文檔: /etc/hosts /etc/host.conf /etc/resolv.conf /etc/named.conf /var/named/named.192.168.1 /var/named/named.tcpip.cxm 1.首先配置 /etc/hosts 指定 Ip 到主機的影射,下面是配置好的文檔 ------------------------------------------------------- #IP Address Hostname Alias localhost 0 pc10 pc10.tcpip.cxm -------------------------------------------------------- 2.接下來是 /etc/host.conf 的配置 -------------------------------------------------------- order hosts, bind multi on -------------------------------------------------------- 這個配置的意思是從 /etc/hosts 開始查詢,然後是 DNS,如果是多個主機將全部返回 3.配置 /etc/resolv.conf -------------------------------------------------------- search tcpip.cxm nameserver 0 -------------------------------------------------------- 這兒配置的是 DNS 客戶,search 指定的是客戶默認功能變數名稱,nameserver 則是指定使用的 DNS 伺服器的 IP 位址,這裏使用的是正在配置 DNS 伺服器的主機 IP 位址:0 4.配置 /etc/named.conf ,這個文檔的配置很重要 -------------------------------------------------------- // generated by named-bootconf.pl options { directory /var/named; /* * If there is a firewall between you and nameservers you want * to talk to, you might need to uncomment the query-source * directive below. Previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an unprivileged * port by default. */ // query-source address * port 53; }; // // a caching only nameserver config // zone . { type hint; file named.ca; }; zone 0.0.127. { type master; file named.local; }; zone 1.168.192. { type master; file named.192.168.1; }; zone tcpip.cxm { type master; file named.tcpip.cxm; }; -------------------------------------------------------- 裏面的 // 後和 /* */ 裏的內容都是注釋,尤其要注意裏面的標點要正確,zone 1.168.192. 是配置反序查找,而 zone tcpip.cxm 則是配置正序查找 5.創建區資料檔案 /var/named/named.192.168.1,只需複製 /var/named/named.local 爲 /var/named/named.192.168.1 進行修改(注意:是複製不是更名),修改後的內容如下: --
显示全部
相似文档