DNS resolver vs DNS server? [closed]
Solution 1:
The thing I don't understand is, why do I need both a DNS resolver AND a DNS server?
This is not the distinction you should hold.
The important distinction in DNS servers is between:
- an authoritative nameserver
- a recursive nameserver
(and you can find others like "stub" resolver, and combination; refer to RFC 8499 for full definitions).
An authoritative nameserver has full data on one or more zones (and zones have typically two and sometimes more authoritative nameservers for load-balancing/fail over).
A recursive nameserver has basically no data (when starting) and will do queries on behalf of a client, and recurse to follow all delegations and CNAME records until arriving at either an error or the answer for the client query.
The recursive nameserver you use (either on your box, or your ISP one, or some remote one like Google Public DNS or Cloudflare one or others) knows about the root nameservers, and will contact them to get data about TLD nameservers, and so on and so forth to finally resolve the name you need.
Each authoritative nameserver has only data for the zones it administer. If you query it for anything else it might either refuse to reply (reply at the DNS level with a REFUSED code), or reply with a delegation to let you know you (you here being the recursive nameserver doing the query) should go contacting another authoritative nameserver.
"DNS resolver" and "DNS server" is ambiguous. A "DNS resolver" is also a "DNS server" in the sense that it runs a "DNS" software acting as a server (accepting queries and responding). The DNS is designed so that the same port (53) is used for both authoritative and recursive operations, which yields to some confusion (in naming, no problems for computers).
Some nameserver software are authoritative only by design (ex: NSD, Yadifa, KnotDNS), some only recursive (ex: Unbound) and some can be configured in either mode (ex: Bind, PowerDNS), even if it is recommended not to mix both operations mode inside the same process.
RFC 8499 is really a mine of information, and a recommended reading.