问题原文
原帖链接 · Ole · CC BY-SA 3.0
I'm reading through the following dns tutorial and it has this example in it:
domain.com. IN SOA ns1.domain.com. admin.domain.com. (
12083 ; serial number
3h ; refresh interval
30m ; retry interval
3w ; expiry period
1h ; negative TTL
)
The description for the negative TTL value says this:
1h: This is the amount of time that the name server will cache a name error if it cannot find the requested name in this file.
What are the conditions that could trigger the server to cache a name error like this? An example would be really helpful.
已采纳解答
原帖链接 · Andrew B · CC BY-SA 3.0
The negative caching interval in the SOA comes into play when an authoritative server indicated that the requested record did not exist. The specific cases are:
- Replies with a response code of
NXDOMAIN. - Replies with a
NODATAsynthetic state, but only forms where aSOArecord is present. (NOERRORrcode, 0 answers, 1SOArecord in authority section + optionalNSrecords)
It's common for server software to enforce a locally configured maximum on this value, so even if you have a negative TTL of 86400 the non-existence isn't necessarily going to be cached for that long by remote recursive servers.
The cases are covered by section RFC 2308 if you want to read further. Read section 2 as a primer, then 5-6.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
