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

What RFC encourages DNS servers to reply REFUSED to queries for unknown domains?

· 52CE 我爱测

This question is very very similar to RFC that requires DNS servers to respond to unknown domain requests but I figured I ought to ask it as a new question. It appears that it is standard practice for an authoritative DNS server …

问题原文

原帖链接 · Quuxplusone · CC BY-SA 3.0

This question is very very similar to RFC that requires DNS servers to respond to unknown domain requests but I figured I ought to ask it as a new question.

It appears that it is standard practice for an authoritative DNS server to respond with rcode REFUSED to any query for a domain name for which the server is not authoritative. For example:

$ dig @ns1.google.com yahoo.com A | grep status
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 53533

There are a few alternative behaviors that could make sense here, a priori:

  • Blackhole the query entirely
  • Return a non-authoritative NXDOMAIN response
  • Return a non-authoritative NOERROR response (this is silly, but I mention it for completeness)
  • Return a canned referral to the root nameservers (this is even sillier)

Is there an RFC or similar document that says "thou shalt return REFUSED in this case"?

I'd expect to see some discussion of this situation in RFC 1034 section 4.3.1 and 4.3.2, but I don't.

已采纳解答

原帖链接 · Håkan Lindqvist · CC BY-SA 3.0

I do not believe that there is a outright statement in the standards documents (at least not the original DNS RFCs) of how to deal with this particular scenario.
That said, over the years the consensus has more or less become that REFUSED is the best option out of what tools we have available.

I'll outline some thoughts on some of the different options below:

The options outlined in the question

Blackhole the query entirely

This is bad for the operator of the authoritative server as this approach would make the server appear to be down, opening for scenarios where recursing servers have observed it repeatedly not answering their queries and give up on it entirely, regardless the QNAME.

It's also bad from the client perspective as it may lead to waiting until some timeout expires rather than quickly getting an error.

(I would consider this the worst option.)

Return a non-authoritative NXDOMAIN response

This is not in line with how NXDOMAIN is otherwise used. NXDOMAIN is used to indicate that you know that a name does not exist, not that you do not know anything about the name.

Return a non-authoritative NOERROR response (this is silly, but I mention it for completeness)

First of all, I'll note that the "referral to the root" alternative is a special case of this one.

The argument against NXDOMAIN applies to NODATA (NOERROR + SOA in authority section) as well with only minor adjustment; it's a status which is used to indicate that you know that there is no such RRset, not that you lack knowledge.
Additionally, NODATA suggests that you know that this name exists in some shape or form (eg, it may have records of other types or it may be an empty non-terminal).

NOERROR indicates that the query was considered valid and answerable, so there should be some form of answer. If this a query that cannot be answered, NOERROR seems like a bad fit.

Return a canned referral to the root nameservers (this is even sillier)

This was a very common way of dealing with this in the past. The contents of the answer are not useful per se but it is a validly formed referral response that at least makes it clear that the queried server doesn't know about that name.

(I think this is probably the least silly form of NOERROR use in this context.)

Other options

Status REFUSED

REFUSED is generally considered the best approach, indicates that the server is configured not to answer this query. Overall a good fit, whether or not it's not explicitly mandated that it must be used in this particular case.

Status SERVFAIL

Also used by some server implementations.
Less clear than REFUSED in that it doesn't clearly indicate that the non-answer is deliberate; SERVFAIL is normally used for unexpected errors encountered when processing valid queries.

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

资料来源与适用范围

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

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

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