I have a use case where i'm frequently registering new subdomains (a.subdomain.example.com
, b.subdomain.example.com
, ...) in my Route53 hosted zone dynamically and poll them until they are available. The DNS query succeeds as soon as the authoritative nameservers are updated and the negative cache has expired. Therefore to not cache the initial NXDOMAIN
(subdomain missing) response from Route53 for the default of 15 minutes i have updated the TTL
value on the root SOA record created by AWS (example.com
) to 30 seconds. This affects all DNS queries though, not only subdomains.
Question: Is it possible/valid to create custom SOA records for subdomains, like subdomain.example.com
, to make scoped adjustments to the TTL
(like 5 seconds there) while keeping the default of 15 minutes otherwise?
Question: Is it possible/valid to create custom SOA records for subdomains, like subdomain.example.com, to make scoped adjustments to the TTL (like 5 seconds there) while keeping the default of 15 minutes otherwise?
Only if they are separate DNS zones, as the literal meaning of the SOA record is to indicate the root of a new zone ("start of authority" of the server), so the DNS server will not normally search for SOA at other levels – it only tracks a single "minttl" parameter per zone.
Most DNS hosting providers should let you create a zone at any level (i.e. it's completely fine to have a 3rd or 4th level subdomain as a separate zone if it has special requirements).
Don't forget to add NS
delegation records to the parent zone pointing to the correct nameservers for the subdomain (i.e. copy them from the child zone).