<div dir="ltr">On Wed, Aug 6, 2014 at 11:33 AM, Casey Deccio <span dir="ltr"><<a href="mailto:casey@deccio.net" target="_blank">casey@deccio.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Google's implementation seems to recursively query for and cache ANY based on the entire set of records for the same name, rather than on a per-record basis. <a href="http://nohats.ca" target="_blank">nohats.ca</a> includes an NSEC3PARAM record with TTL 0. This results in zero caching of ANY queries.<br>
<div class="gmail_extra"><div class="gmail_quote"><div>
<br>For example, contrast the following (looking at the TTLs in the answer):<br><br>casey@rome:~$ dig +dnssec @<a href="http://8.8.8.8" target="_blank">8.8.8.8</a> <a href="http://sandia.gov" target="_blank">sandia.gov</a> soa | grep SOA | awk '{ print $1,$2,$3,$4 }'<br>
;<a href="http://sandia.gov" target="_blank">sandia.gov</a>. IN SOA <br><a href="http://sandia.gov" target="_blank">sandia.gov</a>. 20502 IN SOA<br><a href="http://sandia.gov" target="_blank">sandia.gov</a>. 20502 IN RRSIG<br>
casey@rome:~$ dig +dnssec @<a href="http://8.8.8.8" target="_blank">8.8.8.8</a> <a href="http://sandia.gov" target="_blank">sandia.gov</a> soa | grep SOA | awk '{ print $1,$2,$3,$4 }'<br>
;<a href="http://sandia.gov" target="_blank">sandia.gov</a>. IN SOA <br><a href="http://sandia.gov" target="_blank">sandia.gov</a>. 20497 IN SOA<br><a href="http://sandia.gov" target="_blank">sandia.gov</a>. 20497 IN RRSIG<br>
<br></div><div>with this:<br></div><div><br>
casey@rome:~$ dig +dnssec @<a href="http://8.8.8.8" target="_blank">8.8.8.8</a> <a href="http://sandia.gov" target="_blank">sandia.gov</a> any | grep NSEC3PARAM\\\|SOA | awk '{ print $1,$2,$3,$4 }'<br><a href="http://sandia.gov" target="_blank">sandia.gov</a>. 21599 IN SOA<br>
<a href="http://sandia.gov" target="_blank">sandia.gov</a>. 21599 IN RRSIG<br><a href="http://sandia.gov" target="_blank">sandia.gov</a>. 0 IN RRSIG<br><a href="http://sandia.gov" target="_blank">sandia.gov</a>. 0 IN NSEC3PARAM<br>
casey@rome:~$ dig +dnssec @<a href="http://8.8.8.8" target="_blank">8.8.8.8</a> <a href="http://sandia.gov" target="_blank">sandia.gov</a> any | grep NSEC3PARAM\\\|SOA | awk '{ print $1,$2,$3,$4 }'<br>
<a href="http://sandia.gov" target="_blank">sandia.gov</a>. 21599 IN SOA<br><a href="http://sandia.gov" target="_blank">sandia.gov</a>. 21599 IN RRSIG<br><a href="http://sandia.gov" target="_blank">sandia.gov</a>. 0 IN RRSIG<br>
<a href="http://sandia.gov" target="_blank">sandia.gov</a>. 0 IN NSEC3PARAM<br>
<br></div></div></div></div></blockquote><div><br></div><div>I neglected to provide examples from other resolver implementations. Here's BIND:<br><br>casey@rome:~$ dig +dnssec @localhost <a href="http://nohats.ca">nohats.ca</a> any | grep NSEC3PARAM\\\|SOA | awk '{ print $1,$2,$3,$4 }'<br>
<a href="http://nohats.ca">nohats.ca</a>. 0 IN RRSIG<br><a href="http://nohats.ca">nohats.ca</a>. 0 IN NSEC3PARAM<br><a href="http://nohats.ca">nohats.ca</a>. 3600 IN RRSIG<br><a href="http://nohats.ca">nohats.ca</a>. 3600 IN SOA<br>
casey@rome:~$ dig +dnssec @localhost <a href="http://nohats.ca">nohats.ca</a> any | grep NSEC3PARAM\\\|SOA | awk '{ print $1,$2,$3,$4 }'<br><a href="http://nohats.ca">nohats.ca</a>. 3598 IN RRSIG<br><a href="http://nohats.ca">nohats.ca</a>. 3598 IN SOA<br>
casey@rome:~$ dig +dnssec @localhost <a href="http://nohats.ca">nohats.ca</a> any | grep NSEC3PARAM\\\|SOA | awk '{ print $1,$2,$3,$4 }'<br><a href="http://nohats.ca">nohats.ca</a>. 3597 IN RRSIG<br><a href="http://nohats.ca">nohats.ca</a>. 3597 IN SOA<br>
<br></div><div>Note that the cache started empty, and because it was empty it was populated with all records having name <a href="http://nohats.ca">nohats.ca</a> after the first ANY query. BIND responded to subsequent query with whatever was still in cache. The zero-TTL items had already expired, and BIND did not re-fetch them.<br>
<br></div><div>unbound has yet a third behavior. It seems to cache on a per-ANY basis but maintain TTL on a per-record basis:<br></div><div><br>casey@rome:~$ dig +dnssec @localhost <a href="http://nohats.ca">nohats.ca</a> any | grep NSEC3PARAM\\\|SOA | awk '{ print $1,$2,$3,$4 }'<br>
<a href="http://nohats.ca">nohats.ca</a>. 3600 IN SOA<br><a href="http://nohats.ca">nohats.ca</a>. 3600 IN RRSIG<br><a href="http://nohats.ca">nohats.ca</a>. 0 IN NSEC3PARAM<br><a href="http://nohats.ca">nohats.ca</a>. 0 IN RRSIG<br>
casey@rome:~$ dig +dnssec @localhost <a href="http://nohats.ca">nohats.ca</a> any | grep NSEC3PARAM\\\|SOA | awk '{ print $1,$2,$3,$4 }'<br><a href="http://nohats.ca">nohats.ca</a>. 3598 IN SOA<br><a href="http://nohats.ca">nohats.ca</a>. 3598 IN RRSIG<br>
<a href="http://nohats.ca">nohats.ca</a>. 0 IN NSEC3PARAM<br><a href="http://nohats.ca">nohats.ca</a>. 0 IN RRSIG<br>casey@rome:~$ dig +dnssec @localhost <a href="http://nohats.ca">nohats.ca</a> any | grep NSEC3PARAM\\\|SOA | awk '{ print $1,$2,$3,$4 }'<br>
<a href="http://nohats.ca">nohats.ca</a>. 3596 IN SOA<br><a href="http://nohats.ca">nohats.ca</a>. 3596 IN RRSIG<br><a href="http://nohats.ca">nohats.ca</a>. 0 IN NSEC3PARAM<br><a href="http://nohats.ca">nohats.ca</a>. 0 IN RRSIG<br>
<br></div><div>It's inconclusive from this quick test whether the existing records are being updated or not from the results of the ANY query (it appears that they are not, but I would need to check content), but at least the TTLs are not affected.<br>
</div><div><br></div><div>Regards,<br></div><div>Casey<br></div></div></div></div>