![DNS 请求状态:SERVFAIL](https://linux22.com/image/684495/DNS%20%E8%AF%B7%E6%B1%82%E7%8A%B6%E6%80%81%EF%BC%9ASERVFAIL.png)
你能看看下面的配置以及我做错了什么吗?
刚刚设置了 Ubuntu 14.04.4 LTS 并绑定,当我挖掘我的服务器时,我得到了一个状态:SERVFAIL
我的配置如下:
dig @192.168.6.1 www.example.com
; <<>> DiG 9.9.6-P2 <<>> @192.168.6.1 www.example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 25376
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.example.com. IN A
;; Query time: 5 msec
;; SERVER: 192.168.6.1#53(192.168.6.1)
;; WHEN: Fri Jun 10 12:13:28 UTC 2016
;; MSG SIZE rcvd: 43
named.conf.local包含
zone "example.com" {
type master;
file "/etc/bind/db.example.com";
};
zone "128.10.in-addr.arpa" {
type master;
file "/etc/bind/db.192.168"; # 192.168.0.0/16 subnet
};
named.conf.options
options {
directory "/var/cache/bind";
recursion yes; # enables resursive queries
allow-recursion { any; }; # allows recursive queries from "trusted" clients
listen-on { 192.168.6.1; }; # ns1 private IP address - listen on private
allow-transfer { none; };
allow-query { any; };
forwarders {
8.8.8.8;
8.8.4.4;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
数据库文件
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.example.com. root.example.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
; name server NS records
IN NS ns.example.com.
; name servers A reconds
ns.example.com. IN A 192.168.6.1
; A records
www IN A 192.168.1.21
答案1
错误出现在以下行:@ IN SOA ns.example.com. root.example.com。不要使用上面的代码,而要使用:@ IN SOA 例如.com。root.example.com。