News for hackers. Stuff that matters.
Re:RFC8482 – Saying Goodbye to ANY by derefr on Friday March 15, 2019 @03:49PM (#19403517)
Even though I know how it works, and why it works, I'm still kind of surprised that individual DNS records have individual TTLs. It feels unfamiliar/alien, compared to all the other hierarchy-of-caches systems I work with.

Every intuition I have about caching would lead me to imagine an alternative implementation of DNS where zones are documents, and intermediate resolvers retrieve and cache entire zone documents from their canonical hosts, in order to respond to queries for individual records from stub resolvers.

Is there some big use-case for the DNS records within a zone to have different TTLs? Would it really be so inefficient if the zone as a whole just had one TTL, which was set as the minimum of the TTLs required by any of its records?

Does DNS not have spacial locality to its access patterns? I.e., if an intermediate resolver retrieves the A records for a domain, does that not imply that it'll soon also want the MX records for that domain, and the TXT SPF records, and—essentially—all the records with some probability? Is there no justification for pre-fetching these?

And, if both of those statements were to be true—that DNS could get by just fine with one TTL per zone, and that DNS queries do have a spacially-local access pattern—then why would you want to design DNS in a way where intermediate resolvers retrieve individual records, rather than entire zone documents? Would a modern ground-up DNS architecture do things this way?

(I have the suspicion that the answer lies in security-through-obscurity, vis. the reason AXFRs are prohibited. So, as an addendum: I ask the same questions as above, but this time presuming your DNS daemon has Row-Based Access Control (RBAC), such that an intermediate resolver retrieving a zone document would only see the records its upstream resolver thinks that particular client should be allowed to see—e.g. enterprise Intranet clients get everything, while public Internet clients get a trimmed view. This implies secure DNS, but just take that as a given.)

Re:RFC8482 – Saying Goodbye to ANY by jcrites on Friday March 15, 2019 @04:05PM (#19403696)
Record-level TTLs are useful in practice. Let me give an example. Let's say I am about to make a significant change to the operation of a system. I'm going to flip service.example.com from pointing one place, to pointing somewhere else. If something goes wrong during this deployment, then I want to be able to roll back quickly.

In preparation for this deployment, I might lower the TTL on service.example.com considerably. This way I can roll out my change quickly and observe the effect across all clients, and I can also roll it back quickly. Once the deployment is done, and I don't expect to make further changes to service.example.com, then I can raise the TTL again.

More generally, you might want the ability to propagate changes to the definition of some names much faster than others, and record-level TTLs let you do this. I might be planning to change service.example.com shortly while not planning to change www.example.com any time soon. The downside of low TTLs is a higher volume of queries and thus higher costs, with some implications for availability.

Record TTLs are something that I think about, and consider changing, whenever I'm about to make a significant change to a name.

(Yes, if TTLs only existed for zones, then you could still break out service.example.com into its own zone, and define the TTL there. But if you frequently want different TTLs for different records, then having to do this would be inconvenience without benefit. Service.example.com would be part of its parent zone initially, then you'd have to separate it out into its own zone just for the sake of a different TTL, and then merge it back in later. Under this use-case, zone-wide TTLs only will add complexity.)

Re:RFC8482 – Saying Goodbye to ANY by simcop2387 on Friday March 15, 2019 @04:02PM (#19403666)
The problem with this is that there may not be a single zone file. Either because of location aware resolvers, or because the entry won't exist until it's requested. This means that caching the whole zone wouldn't allow for dynamic resolving and would require lots more caches at whatever granularity someone else wants for their local server architecture.
Re:RFC8482 – Saying Goodbye to ANY by kccqzy on Friday March 15, 2019 @07:00PM (#19405120)
> Does DNS not have spacial locality to its access patterns? I.e., if an intermediate resolver retrieves the A records for a domain, does that not imply that it'll soon also want the MX records for that domain, and the TXT SPF records, and—essentially—all the records with some probability? Is there no justification for pre-fetching these?

Probably not. If I want to visit your website, I might just need A and AAAA. That doesn't mean I will soon want to send you emails (MX) or look at your google site verification token (TXT).

> Is there some big use-case for the DNS records within a zone to have different TTLs? Would it really be so inefficient if the zone as a whole just had one TTL, which was set as the minimum of the TTLs required by any of its records?

Definitely no. I tend to set low TTLs for A and AAAA records because in practice they do change very often. Depending on your setup, it possibly changes every deployment. But on the other hand MX is long-lived and I set it to many days. This is important security implications: if say, Gmail, has cached my MX records for many days, it will be very difficult for a DNS takeover attack to maliciously redirect my mail or other sort of DNS poisoning to do the same.

Re:RFC8482 – Saying Goodbye to ANY by emmelaich on Sunday March 17, 2019 @04:02AM (#19412830)
Fun fact: mailers will use the A record if a domain doesn't have an MX.

See RFC 5321

Re:RFC8482 – Saying Goodbye to ANY by twic on Friday March 15, 2019 @08:58PM (#19405715)
> Even though I know how it works, and why it works, I'm still kind of surprised that individual DNS records have individual TTLs. It feels unfamiliar/alien, compared to all the other hierarchy-of-caches systems I work with.

In HTTP, TTLs are per-resource.

Re:RFC8482 – Saying Goodbye to ANY by cmroanirgo on Friday March 15, 2019 @04:07PM (#19403716)
A self hosted dyn dns requires a short TTL. eg most of a zone could be 2 days, but myhome.example.com can be set to 15 minutes.
Re:RFC8482 – Saying Goodbye to ANY by derefr on Friday March 15, 2019 @04:17PM (#19403836)
In that use-case, there's no reason that myhome.example.com couldn't be broken out onto its own apex, yet still hosted by the same authoritative DNS servers. (I'm continually surprised that there's no easy way in any DNS registrar's UX to say "I want this DNS name to be an NS record pointing back to your own servers, with you automatically updating that association; and then I want you to expose a new top-level zone for me to edit with that new apex FQDN, just as if it was another asset I had purchased from you. The new zone should have an automatically-managed SOA record derived from its parent zone's SOA record, which prohibits transfers; and the parent zone's SOA should be locked down such that it cannot be transfer-enabled either, as long as the child zone exists [just because no other registrar likely supports receiving this mess.]" Totally possible, but no registrar does it. Maybe because it'd make reselling too easy?)
Re:RFC8482 – Saying Goodbye to ANY by codetrotter on Friday March 15, 2019 @05:58PM (#19404701)
But if things are done your way then because myhome.example.com needs to have a TTL of 15 mins now all of example.com must have a 15 min TTL instead of two days.

Now imagine that www.example.com has A LOT of visitors, and myhome.example.com has only OP and his family using it. So now millions of clients need to make up to 96 times more DNS queries each (one day divided by 15 minutes, because 24 hours seems to be the actual maximum amount of time that for example Windows caches positive DNS query replies) because if they are visiting www.example.com and the way too low TTL has expired, all because a handful of people needs a low TTL for myhome.example.com.

Per-record TTL is great and I see no reason to do it the way you are suggesting instead.

Re:RFC8482 – Saying Goodbye to ANY by derefr on Friday March 15, 2019 @06:22PM (#19404867)
> But if things are done your way then because myhome.example.com needs to have a TTL of 15 mins now all of example.com must have a 15 min TTL instead of two days.

Er, why? I was proposing precisely the opposite of that: that if you made myhome.example.com a separate zone from its parent, it'd have a separate TTL.

Honestly, there's no reason (other than the awful UX of current DNS servers and registrars) that any/all subdomains that have reason to change independently, aren't made into independent zones that are simply "managed under" their parent zone.

In software, you decouple components that have different rates of change (e.g. policy and implementation layers), so that teams corresponding to those rates of change can deal with the components using engineering strategies suited to their lifecycles. (E.g. a policy DSL can be quickly modified and pushed by the ops team; while modifying the implementation requires code review and a successful CI build.) Because this is pretty much an unalloyed good, we do it more than we need: we modularize everything, even things with the same needs, because "keep everything modular" is a lot easier of a principle to follow, and it allows us to group things into different change-flow-rate layers after the fact.

So why, oh why, do we not obey this principle with our DNS subdomains? The same team who owns the "microsoft.com" zone is responsible for any changes required to the "technet.microsoft.com" zone, and the "zune.microsoft.com" zone? How crazy is that, as the best-supported, idiomatic-UX default to have in DNS systems?

Re:RFC8482 – Saying Goodbye to ANY by brazzledazzle on Friday March 15, 2019 @07:44PM (#19405391)
Unless I’m misunderstanding something, what you’re talking about is already possible. You can delegate subdomains using NS records (glue records optional, depending). Then you can create a record at the apex, effectively making it a single record zone. The only real exception being that you can’t create a CNAME at the apex. And you can delegate a subdomain of the subdomain in the same way. The delegations can be to completely separate DNS services/servers managed by completely different teams. This hierarchy and ability to delegate not just resolution but also control is pretty fundamental to the protocol.

In practice creating a zone per record would be messy and unnecessary if you didn’t need to delegate control but you could do it if you wanted to.

Re:RFC8482 – Saying Goodbye to ANY by derefr on Saturday March 16, 2019 @11:15AM (#19408218)
My point was precisely that the fact that this process is “messy” is purely a UX problem; and the fact that it’s seen as “unnecessary” (rather than “desirable”) is purely down to the fact that it is more “messy” to do.

This could all be handled internal to the registrar, such that you just see a tree of managed zones, with the ability to create new directories (zones) in the tree with a single click. All that is is a different UX for the capability that already exists. But if you can make a CNAME record with one click; or make a new child zone with an apex A record with one click; then why not the latter?

The reason I was saying that you shouldn’t be able to delegate such child zones—not all child zones, just the ones created through this one-click process—is precisely that being able to do so would make the process of creating them in the first place not one-click, because then they’d have to have SOA records that are independently managed (and so, probably, created with a form you fill out on zone creation, like regular zones), rather than being automatic derivatives of their parent zone’s SOA information. Sure, you could have a control-panel option to turn one of these automatically-managed child zones into a fully-separate top-level zone with the ability to edit its SOA information, delegate it, etc.

But that’s just a two-click process to get what we already have, whereas what I care about is the one-click process that gets you something we don’t have: child zones that are required to be bound to the same authority, and therefore are managed with the simplicity of team-based ACLs [like e.g. the AWS resources in a project] rather than with separate top-level accounts in different registrars. It’d be a one-click operation for the domain administrator of “example.com” to break off “foo.example.com”, and then one more click (of an ACL assignment drop-down) for the domain admin to assign the foo team the use of the child zone “foo.example.com” as a namespace to use however they please (including creating further child zones off of.) But all of that would live under what would currently be considered one account with a DNS registrar or DNS management service.

IMHO, this paradigm would be “the obvious thing” for services like AWS Route53 to offer—it fits in much better with the rest of the “enterprise-wide policy-controlled access on pooled resources” philosophy that these IaaS clouds have, than the current approach (every domain and all its sub domains being managed as single resources with single IAM owners) does.

Re:RFC8482 – Saying Goodbye to ANY by codetrotter on Friday March 15, 2019 @07:40PM (#19405364)
> I was proposing precisely the opposite of that: that if you made myhome.example.com a separate zone from its parent, it'd have a separate TTL

Sorry, I misunderstood your comment then.

Re:RFC8482 – Saying Goodbye to ANY by JdeBP on Saturday March 16, 2019 @06:06AM (#19407128)
Individual resource records have individual TTL fields, but RFC 2181 requires all of the resource records in a resource record set to have the same TTL value as one another.

A more imaginative alternative DNS would make these first-class entities in their own rights.