DNS Servers
Introduction
The same server can be configured to work in both the caching and the forwarding modes.
Caching DNS server
The caching (caching) DNS server works by performing all the DNS queries made by your system and then storing or caching the results in memory.
Once the results are cached in memory, every time you make a duplicate request for a domain, the result will be served from memory almost instantly.
This may not seem very important, but if your provider's DNS servers are slow to answer, it will significantly slow down your web browsing.
For example, to load the MSNBC news channel home page correctly in the US, a browser has to contact more than 100 unique domain names.
If your provider's name servers answer even 10 seconds longer than usual, that means the page will take 10 seconds longer to load.
A local caching DNS server will help not only in your home or office, but also on your server. If you have an application that performs many DNS lookups, for example a busy mail server running anti-spam software, it will get a speed boost from a local caching DNS server.
Finally, systemd-resolved supports the latest secure DNS standards, DNSSEC and DNSoverTLS or DoT. This helps keep you secure and preserve your privacy on the Internet.
DNS forwarding improves performance, balances the load and makes your network more resilient.
It provides a way to pass the namespaces or resource records that are not contained in the zone of the local Domain Name System (DNS) server to a remote DNS server
for resolving name queries both inside and outside the network.
There are two methods that we will discuss: forwarding (Forwarding) and conditional forwarding (Conditional Forwarding).
To understand the advantages of conditional forwarding, we must first understand how ordinary forwarding works.
Forwarding server
In a simple example, a forwarding DNS server sends name queries for external domains to remote DNS servers outside its local network for resolution.
Internal name queries are handled by the internal DNS server
If the DNS server has no forwarder specified for the name given in the query, it may try to resolve the query using standard recursion with the help of the root hints file
There are two types of DNS name queries: recursive and iterative.
Although both DNS forwarding and conditional DNS forwarding follow the general steps described above, each of them is slightly different.
Recursive name query
Forwarded queries are sent in recursive form.
In this case the DNS client requires the DNS server to answer the client either with the requested resource record or with an error message stating that the record or domain name does not exist.
The DNS server cannot simply redirect the DNS client to another DNS server.
Recursive name queries are resolved faster than iterative name queries
Iterative name query
The DNS client allows the DNS server to return the best answer it can give based on the data in its cache or zone.
A DNS server configured to use forwarding will behave differently from a DNS server not configured to use forwarding.
Here is how a DNS server works when forwarding is used
- When a DNS server receives a name query, it tries to resolve that query using its primary zones, secondary zones and finally its cache in that order.
-
If the name query cannot be resolved using the data of the local zone or cache, it will forward the query to the DNS server designated as the forwarder.
As a result, the root hints name resolution method will not be used. -
The original DNS server that received the initial query will wait briefly for an answer from the forwarder.
If that fails, it will try to contact the DNS servers listed in its root hints as a last resort.
Conditional forwarding
Conditional forwarding (Conditional Forwarding) makes it possible to improve name resolution between internal (private) DNS namespaces, which are not part of the Internet DNS namespace. For example, those resulting from company mergers
Related Articles:
Article author: Andrei Olegovich