Hi everyone, I’m studying how DNS works. According to cloudfare, ONLY authoritative servers contain DNS records but this makes no sense to me. How are root and TLD nameservers able to direct the recursor towards the authoritative nameserver if they have no records of their own? Also what about the NS record? It points towards the domain’s authoritative nameserver so why would an authoritative nameserver have an NS record itself? I’d really appreciate it if you could help me out understanding this.
I bet they meant records of the requested website (ex.: my.website.something.com), not all records. NS and glue records are stored in zone files and are maintained and updated by registrars (zone administrators). There are no clear borders of DNS zones, and they are not limited to one server, the same like one server can contain multiple zones. Each server in a zone needs NS record to point to appropriate authoritative server.
Recursive server (your ISPs server or some public servers like 22.214.171.124 - cloudflare, 126.96.36.199 - google) know all root servers and it picks the nearest one to query, and then root server responds with directions to appropriate TLD based on the top-level domain of queried address (.com, .edu, etc.). TLD servers have information about all domain names under certain top-level domains (there is one for .com, one for .edu and so on), and TLD servers responses contain direction for recursive servers to authoritative resolver.
Great, Recursive servers also cache information, so if they have info on how to resolve your query to address, they use this info, so full querying process is not always necessary.