
我的帶區域的文件
我的/etc/bind/db.piduna.org
;
; BIND data file for local loopback interface
;
$TTL 604800
$ORIGIN piduna.org.
@ IN SOA ns1.piduna.org. root.piduna.org. (
2018031701 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.piduna.org.
@ IN NS ns2.piduna.org.
@ IN A 192.168.110.15
ns1 IN A 192.168.110.15
ns2 IN A 192.168.110.14
abc100 IN A 192.168.110.1
abc101 IN A 192.168.110.2
abc102 IN A 192.168.110.3
abc103 IN A 192.168.110.4
abc104 IN A 192.168.110.5
abc105 IN A 192.168.110.6
abc106 IN A 192.168.110.7
abc107 IN A 192.168.110.8
abc108 IN A 192.168.110.9
abc109 IN A 192.168.110.10
abc110 IN A 192.168.110.11
abc111 IN A 192.168.110.12
abc112 IN A 192.168.110.13
abc113 IN A 192.168.110.14
abc114 IN A 192.168.110.15
gitlab IN A 192.168.110.14
redmine IN A 192.168.110.14
* IN CNAME piduna.org.
192.168.110.*
當然不是真實的ip位址。相反,我使用 vps-s 的真實 IP 位址。
我的/etc/bind/named.conf.local
:
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "abchosting.org" {
type master;
file "/etc/bind/db.piduna.org";
};
我的/etc/bind/named.conf.options
:
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
listen-on port 53 {
127.0.0.1;
192.168.110.15;
};
forwarders {
8.8.8.8;
8.8.4.4;
};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { none; };
};
所以,我已經測試過了。一切都好。作品。但我對我的配置有疑問 /etc/bind/db.piduna.org
。是否一切都好。也許安全方面有一些建議?我重複一遍,我是為外部網域製作的。我需要:
- 我的 vps-s 的 15 筆 A 記錄;
- 我的服務有兩個 A 記錄,例如 gitlab 和 redmine;
- 從 192.168.110.15 ping 子網域
感謝您的理解和幫助。
答案1
你說你已經測試過了,那你到底做了什麼?named-checkzone
?有什麼線上故障排除工具嗎?
你還有什麼疑問?你的問題太廣泛了。你說的安全是什麼?
但我看到了各種問題:
- 您正在使用通配符記錄。你真的需要它嗎?如果沒有,我建議刪除它,因為它產生的問題遠遠多於解決方案
- 所以你似乎有一個權威的名稱伺服器,因為你定義了一個區域,但它只偵聽本地/內部 IP 位址。這是否意味著它不可全局訪問(這對於權威名稱伺服器來說是一個壞主意),或者您在它前面有一些 NAT 設置,這對於名稱伺服器來說也是一個非常壞的主意?
- 所以你似乎有一個權威的名稱伺服器,但你在外部轉發查詢。看來你在同一台伺服器中混合了遞歸和權威功能,這在安全方面是一個非常糟糕的主意(也可以說,在任何情況下轉發到Google 公共DNS 在安全方面都不是一個好主意,你應該有你的自己的本地遞歸名稱伺服器)