大网数据广告活动
服务器运维问答

SERVERFAIL error while doing nslookup on server itself. FreeBSD

· 52CE 我爱测

I am using FreeBSD to setup a DNS server. I have install BIND and setup everything in resolv.conf and named.conf file. This is the ip address of my DNS server 192.168.10.100 . in resolv.conf I added the following line, nameserver…

问题原文

原帖链接 · Riley Willow · CC BY-SA 3.0

I am using FreeBSD to setup a DNS server. I have install BIND and setup everything in resolv.conf and named.conf file.

This is the ip address of my DNS server 192.168.10.100.

in resolv.conf I added the following line,

nameserver 192.168.10.100

I have also create a zone in named.conf file called .pbv, and then I have used nsupdate to add a domain to this zone which is testing.pbv

Now, when I nslookup 192.168.10.100 on the server itself, it doesn't work and always return,

;; Got SERVFAIL reply from 192.168.10.100, trying next server
;; connection timed out; no servers could be reached

However when I nslookup testingpbv it returns following,

Server:         192.168.10.100
Address:        192.168.10.100#53

Name:   testing.pbv
Address: 192.168.10.100

I don't understand why I cannot run nslookup 192.168.10.100 ?

This is my resolv.conf

nameserver 192.168.10.100
nameserver 8.8.8.8

It merits mentioning here that I can't even lookup google.com or any other external domain for that matter.

已采纳解答

原帖链接 · Andrew B · CC BY-SA 3.0

There are a few things going on here. Let's break it down.

  • Unless you've configured a reverse zone for 10.168.192.in-addr.arpa, your recursive server has to get this information from somewhere else. You have not mentioned setting up such a zone, so I will assume that it does not exist.
  • RFC 1918 private networks are not routed on the internet. If a DNS server has to perform full recursion on a reverse DNS request for this IP space, one of two things happens:
    1. Recursion is performed until IANA's blackhole servers are reached. They will return a response of NXDOMAIN.
    2. The server skips the step of reaching out to the internet because it knows it is pointless. It forges a response of NXDOMAIN and does not waste the bandwidth. BIND 9.9 and upward does this through something called automatic empty zones.

To simplify all of this, if you're seeing SERVFAIL here it means something is broken. Either the server is trying to get the answer from the internet and failing to do so, or you have a broken configuration and are not reading the logs closely enough. (as an example, this would happen if you had created a zone with illegal syntax for 10.168.192.in-addr.arpa)

To rule out a network problem, you can try running dig +trace 10.168.192.in-addr.arpa. If this command returns an error, you will need to troubleshoot your network. If it does not return an error, examine your logs more carefully.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-05-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。