Score:1

How do the TLD DNS servers handle so many zone file updates?

cn flag

I've always wondered how the DNS infrastructure for (say a .com) TLD is designed. It must not only be able to maintain a high level of reliably, but also support high amounts of real-time updates to the records.

I would assume that ISC's BIND is used at that level. I have a fairly clear picture on how someone would build scalable infrastructure using BIND. The part I am unclear on is how would someone design a system that can handle the addition, deletion, and change of hundreds of DNS zones every few seconds. There are countless domain registrars in the world and .com alone probably see's an enormous amount of activity. How does a system built on BIND zone files scale up to that much change?

Am I right to doubt that a TLD operator is using text files and constantly having BIND reload the changes every time a new .com is registered? If so what do they do? Is it an SQL or LDAP database backed? does that even scale?

djdomi avatar
za flag
well, even its a good question. I miss here the business problem you are working on. mostly you can hot add and remove the zone from bind. I think that such bind installations are not on a i386 with 40mhz and 2mb of ram to say it in sarcastic/ironically. Furthermore as more often a item will be requested it will ve caching it into the ram. but as told it requires detailed information what you really want to solve with this?
anx avatar
fr flag
anx
The question seems to presume the storage backend choice is motivated primarily by update latency. The obvious solution is to reimplement the wheel and ship yet another almost-thread-safe set of RDBMS features. Using liblmdb and then still hand-stitching the places where domain-specific features mandate update atomicity guarantees is certainly *fast* enough. But *fast* updates & responses are not the only concern, ideally mitigating SPOF & resolving faults would work with procedures established for other general-purpose database servers.
Tuaris avatar
cn flag
@djdomi it's not necessarily a business problem that needs solving (at least from my perspective). I like to understand how things work and how systems scale. There seems to be very little information on this topic. DNS hosting services for the actual delegated zones could have many users adding new domains, making record updates. The TLD DNS servers do perhaps see a lower amount of changes, and maybe they can suffice with just text files that auto reload after a new domain is registered. I figured that something more elaborate was in place for something so mission critical
Score:3
cn flag

First, do you really think that there are more updates than let us say, credit card transactions per seconds in the world, managed finally by only 2 or 3 companies? Those work, so it is a solvable problem :-)

Second, you might be confused on how updates are happening, because it is a non often understood part where two planes intersect: the registration plane and the publication plane. You might as well be confused by what exactly happens on registry nameservers (only maintaining the NS records for delegations of domains, and NOT the full content of those zones).

But before going into that you also seem to assume that updates should be real-time where they both don't need too and often aren't. Nothing is real time anyway in the DNS, because of the TTL.

So back to your two planes:

  • registrars send updates to registries, when nameservers change and other operation that have DNS side effects (ex: setting up EPP clientHold status); this is the registration plane, it is completely UNCORRELATED to DNS publication, and typically uses a protocol called EPP; when registry replies "update accepted" it absolutely does not mean it is published already on their DNS infrastructure, it is just a guarantee "it will be at some point"
  • registries maintain the DNS publication plane, making sure their nameservers do publish the correct NS records for all delegations, aka all domains registered under the TLDs they manage.

As such, the number of changes is probably far smaller that you have in mind: if a .com owner changes the content of its zone, with new records, in most cases, there is nothing to do through the registrar and nothing changes at the registry authoritative nameservers.

And those changes do NOT happen through DNS Update mechanism. Changes are pushed by registrars using a specific protocol, EPP, changes are stored somehow in some registry database, after which the new data is published by the registry on its authoritative nameservers.

You seem also to think "real-time" is mandatory. It is not, at least not technically, and may even by an ineffective design (consider if you want to do tests that the new changes make sense, as some registries are doing by checking that the name nameservers are correctly configured for resolution of the name they will soon be listed as authoritative for, or DNSSEC tests for example...).

A typical way of setup, used by many registries providing things like a "10-minutes delay for updates" or "1-hour", is to store in some internal buffer all changes requested in that given period of time, then once for all generate the new zone and publish it, while starting a new buffer to collect all the changes that will came in the next period.

I would assume that ISC's BIND is used at that level.

Not at all. Verisign runs its own proprietary nameservers software, called Atlas. See for example https://www.enterpriseappstoday.com/news/verisign-accelerates-dns.html Note that in this 2004 article it is already said:

VeriSign Naming and Directory Services (VNDS) promises to update the core 13 .com and .net authoritative name servers in less than five minutes. The current rate is about twice per day.

Of course it improves since then. But I believe even once per 5 minutes to be largely good enough for any real practical use of the DNS.

There could be also contractual obligations, and specifically for gTLD registries and registrar that are all under contract with ICANN. Current Verisign-ICANN contract is at https://www.icann.org/en/registry-agreements/details/com You can find in §6.6 of the appendix at https://www.icann.org/en/registry-agreements/com/com-registry-agreement-appendix-7-1-12-2012-en details on the update constraints:

6.6 Update Frequency. The Registry Operator makes timely updates to the data on the DNS Name Servers and Whois. ICANN-Accredited Registrars record these updates through the SRS. The SRS then updates the DNS Name Server and the Whois. Registry Operator processes this updates on a near real time basis.

The committed performance specification with regards to Update frequency for both the DNS Name Server and the Whois is 3 minutes for 95% of the transactions during a Monthly Timeframe. That is, 95% of the updates to the DNS Name Servers and Whois during a Monthly Timeframe will be completed within 3 minutes. Update frequency is measured from the time that the Registry Operator confirms the update to the time the update appears in the DNS Name Server and Whois. Update frequency performance will be reported on a monthly basis to ICANN in accordance with Appendix 4.

Do note the usual mark at "95%" used for lots of SLA. So it is near real time when feasible, but in practice typically 3 minutes (hence the typical buffer setup described above).

I have a fairly clear picture on how someone would build scalable infrastructure using BIND. The part I am unclear on is how would someone design a system that can handle the addition, deletion, and change of hundreds of DNS zones every few seconds.

Verisign has only a couple of zones: .com, .net, some IDNs, etc. They don't manage "hundreds of zones". And certainly not hundreds of them with lots of changes every seconds.

You may/want to be more interested by DNS providers that do hosts million of zones with possible high frequency of updates. Here is one article from CloudFlare where they explain what they do performance wise regarding their authoritative DNS service: https://blog.cloudflare.com/how-we-made-our-dns-stack-3x-faster/

There are countless domain registrars in the world

No, not all. Far from countless. Less than 2000 in fact, and probably only like 500 really active with high volumes of changes. All registrars for gTLDs have to be accredited by ICANN. You can find the whole list of them at https://www.icann.org/en/accredited-registrars

Am I right to doubt that a TLD operator is using text files and constantly having BIND reload the changes every time a new .com is registered?

No sane high level of transactions nameserver software would be backed by text files. Even Bind isn't: when dynamic updates are enabled, you have a "journal" file (which is binary) and you specifically shouldn't edit the text file version of the zone (without first freezing updates and then allowing them again after the edit).

If so what do they do? Is it an SQL or LDAP database backed? does that even scale?

I doubt that either SQL or LDAP are good storage engines for DNS. Remember the DNS is hierarchical in nature, which poses various constraints.

Tuaris avatar
cn flag
This is an excellent detailed answer. My main takeaway is that the serious solutions will go towards writing proprietary software for the task. Fully understandable, but a bit disheartening in some way.
Patrick Mevzek avatar
cn flag
@Tuaris I don't think a non proprietary solution wouldn't fit the bill either (just not the basic vanilla setup of course). A choice of open source or not is not always just based on technical merits. Some other registries did build an open source nameserver that they use internally, see EURId for `.eu` TLD that created Yadifa.
Score:1
my flag

First of all, in some cases you don't have to reload immediately.

If you have an SLA saying "pay us and you'll have your domain registered within X hours", you could even reload periodically using some cron job or similar. So, some registrars may be using flat files and reload periodically.

Keep in mind that you could have multiple DNS servers associated to the same IP address (for example, using anycast), so you could even set up a "rolling deploy" mechanism, which changes the flat file everywhere and reloads one DNS server at a time.

That said, Bind >9 supports DLZ (Dynamically Loadable Zones), which essentially allows Bind to use a database as a zone data backend. Databases (and database connections) can then be scaled according to classic database scaling strategies as long as you have a valid DLZ driver for your database.

Finally, as one comment said, vertical scaling (i.e. having a lot of CPU, RAM and IOPS for each server) helps.

There is a 2009 SANOG slide you may find interesting, although it is obviously a bit outdated: https://www.sanog.org/resources/sanog14/sanog14-devdas-dns-scalability.pdf

Tuaris avatar
cn flag
I think I saw somewhere a gTLD zone that was almost 28GB, but that was a data export to satisfy some requirement ICANN has. It does seem like DLZ or a proprietary system that uses a database or key/value backend must be in place with that type of scenario.
Patrick Mevzek avatar
cn flag
@Tuaris See https://serverfault.com/a/1061258/396475 for example.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.