我们在我们的 DNS 服务器上使用 Bind9。我们在 /var/named/slaves 目录中使用以下格式构建了所有区域文件:
mywebsite.com.hosts
mysecondwebsite.com.hosts Run Code Online (Sandbox Code Playgroud)
每个 .hosts 文件都包含以下信息:
$ORIGIN .
$TTL 3600 ; 1 hour
mywebsite.com IN SOA dns1.xxx.xxx. postmaster.xxx.xxx. (
2012042601 ; serial
3600 ; refresh (1 hour)
600 ; retry (10 minutes)
86400 ; expire (1 day)
3600 ; minimum (1 hour)
)
NS dns1.xxx.xxx.
NS dns2.xxx.xxx.
A 168.xxx.xxx.xxx
$ORIGIN mywebsite.com.
www A 168.xxx.xxx.xxx Run Code Online (Sandbox Code Playgroud)
我们的 named.conf 文件包含以下信息:
options {
directory "/etc";
pid-file "/var/run/named/named.pid";
recursion no;
notify yes;
listen-on { 10.xx.xx.xx; 127.0.0.1; };
allow-transfer { 10.xx.xx.xx; …Run Code Online (Sandbox Code Playgroud)