Note: This bug affects customers who use Cloud Map with App Mesh. Although it is not an App Mesh-specific issue, the bug has been reported in this repository for visibility and resolution tracking.
Summary
When using a Cloud Map namespace that's associated with a public or private Route 53 hosted zone, the negative caching TTL is not adjustable. For public hosted zones, the TTL is 900 seconds. For private hosted zones with the use of the VPC DNS resolver (IP address ending in .2), the TTL is 300 seconds. See the Route 53 documentation for how this TTL is determined.
The negative caching TTL is used whenever a requested DNS name contains no records. When this occurs, the DNS server responds with NXDOMAIN, and that value is cached for the time indicated above. In the event that all records are removed for a given DNS name, clients querying DNS will continue to see NXDOMAIN responses until the cache has expired.
Steps to Reproduce
dig utility on an EC2 instance within the VPC associated with the private hosted zone, query DNS for the record and assert that you receive the IP address you entered in step 3. (example command: dig my-service.namespace.cluster.local)NXDOMAIN response.NXDOMAIN response until the negative caching TTL (300 seconds for a private hosted zone using the VPC DNS resolver) expires.Are you currently working around this issue?
To mitigate the impact of the negative caching TTL resulting in no records being returned (and a potential outage):
This is additionally a vector for issues seen in #151
Today AWS Cloud Map released new default values for negative DNS caching. Now it is 15 seconds for namespaces with private DNS resolution (instead of 300 seconds) and 60 seconds for namespaces with public DNS resolution (instead of 900 seconds). These new defaults apply to new namespaces, created on or after 09/14/2020 only. We continue working on enabling modification of negative DNS caching settings for all existing namespaces as well.
I'm seeing an SOA TTL of 86400s (1 day) on an older zone, created via the ECS console, probably in 2018/19.
In fact, I'm still seeing a TTL of 86400s (1 day) on a brand-new zone created through the ECS console today.
@nbryant42 -- could you please share your SOA record?
@herrhound sure. As obtained from dig qa-01.semsee SOA, the record is
qa-01.semsee. 15 IN SOA ns-1536.awsdns-00.co.uk. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
@nbryant42 - as per the RFC2308, when the authoritative server creates this record its TTL is taken from the minimum of the SOA.MINIMUM field and SOA's TTL. In your case the TTL of the SOA record itself is set to 15 seconds, so your client applications won't cache the negative DNS results for longer than that.
@herrhound Thanks. That makes sense, and seems consistent with the application behavior I've seen.
I still have two older zones that have a 900s TTL on the SOA record. It would be inconvenient to delete them and replace them, but guess I'll do that if I have to.
@nbryant42 -- We are working on the API and console experience to update the SOA TTL for the existing hosted zones. I can't comment on the timeline, unfortunately. If it's critical for your workloads, recreating the Cloud Map namespaces will solve the issue today. Otherwise, you may save yourself the hassle.
AWS Cloud Map now supports changing the SOA TTL for new and existing hosted zones: https://aws.amazon.com/about-aws/whats-new/2021/07/aws-cloud-map-supports-configuring-negative-caching-for-dns-queries/
Closing the ticket.
Most helpful comment
Today AWS Cloud Map released new default values for negative DNS caching. Now it is 15 seconds for namespaces with private DNS resolution (instead of 300 seconds) and 60 seconds for namespaces with public DNS resolution (instead of 900 seconds). These new defaults apply to new namespaces, created on or after 09/14/2020 only. We continue working on enabling modification of negative DNS caching settings for all existing namespaces as well.