由于 Dnsmasq 不支持 Views,我已经安装并配置了 bind9。一切正常,但是我注意到我的绑定服务器没有返回与 Dnsmasq 相同的答案/响应的特定条目。我怎样才能做到这一点?
这是我的 Dnsmasq 服务器的配置:
address=/override-url.example.com/54.210.175.6
这是来自我的 Dnsmaq 服务器的 dns 响应:
$ dig @127.0.0.1 override-url.example.com
回复:
; <<>> DiG 9.9.5-3-Ubuntu <<>> @127.0.0.1 override-url.example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53532
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;override-url.example.com. IN A
;; ANSWER SECTION:
override-url.example.com. 0 IN A 1.2.3.4
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Wed Aug 06 21:58:44 UTC 2014
;; MSG SIZE rcvd: 58
这是我的绑定配置和区域文件:
zone "override-url.example.com" {
type master;
file "/etc/bind/override-url.example.com";
};
和区域文件:
$TTL 3600
$ORIGIN override-url.example.com.
@ IN SOA localhost. hostmaster.localhost.com. (
20140805 ; sn = serial number
86400 ; ref = refresh = 1d
900 ; ret = update retry = 15m
1209600 ; ex = expiry = 2w
3600 ; min = minimum = 1h
)
; we need at least 1 name server
IN NS
; override public ip with this address
IN A 54.210.127.53
当然,这里是从 bind 中返回的与上面的答案不匹配的数据。我想尽可能地匹配它。
; <<>> DiG 9.8.3-P1 <<>> override-url.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 12930
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;override-url.example.com. IN A
;; Query time: 36 msec
;; SERVER: 54.88.72.140#53(54.88.72.140)
;; WHEN: Wed Aug 6 18:04:23 2014
;; MSG SIZE rcvd: 42
我应该对绑定区域文件进行哪些更改以使其看起来尽可能接近 dnsmasq 设置?
想通了,必须进行以下更改:
添加
minimal-responses yes;
到named.conf.options
并将区域文件更改为以下内容: