# systemctl stop firewalld.service
設定下次開機不會啟動 Firewalld 防火牆
# systemctl disable firewalld.service
關閉 SELinux:
# vi /etc/selinux/config
安裝 Wget 及Vim程式
# yum install -y wget
# yum install -y vim
安裝 ntpdate 程式
# yum install -y ntpdate
# ntpdate -u time2.google.com
=================================
update yum套件
# yum update -y
安裝 bind 軟體
# yum install bind -y
# yum install bind-utils -y
編輯 namd 的設定檔
# vi /etc/named.conf
啟動DNS服務:
# systemctl start named
檢查 named.conf 是否有錯誤
#named-checkconf /etc/named.conf
安裝 ntpdate 程式
# yum install -y ntpdate
# ntpdate -u time2.google.com
=================================
update yum套件
# yum update -y
安裝 bind 軟體
# yum install bind -y
# yum install bind-utils -y
編輯 namd 的設定檔
# vi /etc/named.conf
啟動DNS服務:
# systemctl start named
檢查 named.conf 是否有錯誤
#named-checkconf /etc/named.conf
檢查 正解的檔案 是否有錯誤
#named-checkzone /var/named/forware.net
檢查 反解的檔案 是否有錯誤
#named-checkzone /var/named/reverse.net
# systemctl status named.service
# systemctl restart named.service -->重新啟動BIND
設定開機啟動:
# systemctl enable named
=============================
WEBMIN 安裝網址
Webmin bind 無法啟動更改位置
到 Configuration 設定裡面,有一項「Default PID file location(s)」路徑修改就可以了。
修改為「 /var/run/named/named.pid」再 Save 就可以。
=============================
Failed : Missing dig command 的錯誤訊息
# yum install bind-utils -y
=============================
出現下列這個錯誤訊息,是因為CentOS 7 Bind傳輸已經使用 RAW方式加密了。
This zone is in raw binary format, and so cannot be displayed as text.
On CentOS 7 / RHEL 7, which uses BIND 9.9.4, Webmin's BIND module will "blindly" convert a Slave zone to a Master, pointing to the existing zone file.
However, by default BIND 9.9 stores its Slave zones in a "raw" / binary format, which it can't successfully read when trying to parse a Master zone file. Attempting to do so will prevent
named
from starting. (It's also limiting in webmin, which can display records but not the 'zone file' contents).
The workaround I've enabled in my environment is to set the
masterfile-format
to text
across the entire BIND instance, rather than the default of raw
. The following config example in the master named.conf
's options
declaration helps.
解決方式如下:
BIND-wide config (in named.conf / etc)-->Master DNS
options {
//
// various named config options
//
masterfile-format text;
//
// the rest of the config
//
}
Zone-specific config (in named.conf / etc)-->Slave DNS
zone "somedomain.net" {
type slave;
masterfile-format text;
masters {
1,2,3,4;
};
file "/var/named/slaves/somedomain.net.hosts";
};
參考來源 Why GitHub?