Root DNS servers may be the most typical primary(not read-only) DNS servers. There are currently 13 IP addresses for root DNS servers; however, considering the IP anycast technology, more than 13 root DNS servers are deployed worldwide.
If someone wants to update a DNS record for all root DNS servers, is there some sync or replication mechanism between all these DNS servers?
More complex, if two people want to update the same DNS record simultaneously, how does DNS solve the potential conflict?
e.g., person A
updated a DNS record r1
to r2
on a.root-servers.net.(deployed at region A)
, and at the same time, person B
updated the same DNS record r1
to r3
on a.root-servers.net.(deployed at region B)
; moreover assuming there is significant network latency between region A
and region B
.
The second problem is similar to a database cluster in that there is more than one primary database server, and these primary servers sync data from all other primary servers.
Root is a list of the DNS servers where the authorities on the top level domains can be found. (Many DNS queries never reach a root server, and get a cached response from somewhere else.) There is one root zone maintainer who generates it. Every root server maintainer grabs it with DNS zone transfer and replicates it internally with a site-specific mechanism. Those root servers can be found shipped with DNS software, or in the root-servers.net zone here or here.
Top level domains change relatively infrequently. Even though this replication is to 13 different operators of hundreds of instances, the eventual consistency does not matter in practice. By the time registering a domain at a new TLD has opened, its DNS servers likely have long been in the root.
13 names, 26 IP address, many anycast instances. All root servers have both IPv4 and IPv6 service addresses. Any one can be used, take your pick.
See also: Can the IP address of a root nameserver change?
To answer your first question : 'How DNS zones are synced between TLD DNS servers'
Root DNS servers and TLD DNS mechanisms are VERY different from lower level common DNS servers. In short, each TLD will have their own mechanisms for keeping servers in sync. They may use zone transfers, or they may have very specific scripts to sync and error-check zone data between all nodes.
And for your second question : 'How does DNS prevent conflicting updates'
This is handled in plain DNS protocol by having a DNS master which will receive or make changes to the zone data, but the rest of the DNS slaves will not have authority to change anything. Additionally the zone changes are tracked with a serial number in the SOA record. Authoritative DNS servers use this information to figure out if they are 'behind' and need to get a fresh copy of the zone.
Since there is really just 1 master for a given zone, it isn't really possible to have conflicting changes.