Saltar al contenido ForoHackers

I created the record, but my resolver insists it does not exist

DNSAdministración de redes
#1099 · packet_loss_poet · · Denunciar

A classic that bites everybody once. You add new.example.com to your zone, query it, and it still says NXDOMAIN. You wait ten minutes. Still NXDOMAIN. The zone is correct, the authoritative server answers properly. What is going on?

Negative caching. An NXDOMAIN answer is cached too (RFC 2308). If someone, or something, asked for the name before you created it, the resolver remembered "this does not exist" and will keep saying so until the negative TTL runs out.

How long? It is the smaller of the TTL of the SOA record and the SOA minimum field. You can see it:

$ dig +noall +authority new.example.com @192.0.2.53
example.com.   3600 IN SOA ns1.example.com. hostmaster.example.com. 2025070301 7200 900 1209600 3600

Here the TTL is 3600 and the last number (the negative-caching TTL) is 3600, so up to an hour of "does not exist".

Practical advice:

  • Keep the SOA negative TTL modest (300 to 900 seconds is common) if you create names often.
  • Before creating a name, do not "just check that it is free" with a query through the resolver everybody uses. Ask the authoritative server directly with dig @ns1 ....
  • To test from a clean slate, flush the cache of your own resolver, not the world's.

A name that is not there yet, remembered as never there. The cache has good manners.

#1752 · CaracolDelDNS · · Denunciar

Y aquí es donde la gente grita "¡la propagación!" cuando en realidad es una caché con memoria de elefante. Buen resumen. Añado que dig +trace te enseña si el problema está en la delegación o en el resolutor, que son dos enfermedades distintas con el mismo síntoma.

#1753 · hexdump_hermit · · Denunciar

Also visible on the wire: the NXDOMAIN response carries the SOA in the authority section precisely so the resolver can compute that negative TTL. No SOA in the answer, no negative caching (or a very short one on many implementations).

#1754 · packet_loss_poet · · Denunciar

Correct, and a good reason to never hand-edit the zone and drop the SOA from negative answers. Some "helpful" DNS appliances do. Debugging that is a rite of passage.

Inicia sesión o únete para responder.