F5 DNS resolver cache is a feature that enables BIG-IP system to resolve DNS queries itself using either an iterative or a recursive method. It caches DNS responses and answers subsequent queries for the same name from the cache. This improves DNS performance and reduces the load on external DNS servers.

Table of Contents

F5 DNS Resolver Cache Fundamental

Forward Zone in DNS Resolver Cache

In the previous section, we discussed various cache types supported by F5 DNS and demonstrated the F5 DNS transparent cache.
In this section, we demonstrate another type of F5 DNS cache, the “resolver cache,” where F5 itself attempts to resolve DNS queries and cache the response.

F5 BIG-IP DNS Cache Types
F5 BIG-IP DNS Cache Types

Depending on the “forward zoneconfiguration, F5 DNS resolver cache decides whether to use an iterative or recursive method to resolve DNS queries.
In the “forward zone”, we configure a list of DNS servers that the resolver cache will use to resolve DNS queries.

F5 DNS Resolver Cache and Forward Zone
F5 DNS Resolver Cache and Forward Zone

When you configure a “forward zone” for the resolver cache, the resolver cache uses the recursive method to resolve the DNS query. This means that the resolver cache sends the request to the servers configured in the forward zone and expects to get the final response.
If you do not configure a “forward zone” for the resolver cache, the resolver cache uses the iterative method to resolve the DNS query. This means that the resolver cache sends the query first to the root hints server, then to the TLD server, and then to the authoritative DNS server to get the final answer.

F5 DNS Resolver Cache Configuration

Create a Resolver Cache

To configure the F5 DNS resolver cache, we first create a new cache of type “Resolver”.
In the section “DNS > Cache > Cache List”, we create a new cache with the name “dns_resolver_cache” and the type “Resolver”.
At the bottom of the resolver cache configuration page we have the option to configure new “root hints”, root DNS servers. Usually we leave the field blank to use default root DNS servers.

create F5 DNS Resolver Cache
create F5 DNS Resolver Cache

Configure Forward Zone (Optional)

When you click the configured resolver cache, the “Forward Zone” tab allows you to configure a list of DNS servers to which the DNS resolver cache forwards the query for the resolution.
In other words, if you configure “Forward Zone”, the DNS resolver cache uses a recursive method to resolve the queries.
As an example, I will configure a list of DNS servers with IP addresses “1.1.1.1”, “4.2.2.4” and “8.8.8.8” and the name “forwarder”.

create Forward Zone in DNS Resolver Cache
create Forward Zone in DNS Resolver Cache

create a DNS Profile

We then create a new DNS profile to use the configured resolver cache.
In the “DNS > Delivery > Profiles > DNS” section, we create a new DNS profile based on the existing default “dns” profile.
I configure the name as “resolver_cache_dns_profile”. Enable the DNS cache of the resolver type and also disable the BIND service to improve performance.

create DNS Profile with Resolver Cache activated
create DNS Profile with Resolver Cache activated

create a DNS Listener

In the final step, we configure a new DNS listener to use the new DNS profile we just created that uses the DNS resolver cache.
In the “DNS > Delivery > Listeners > GTM Listeners > GTM Listeners List” section, we create a new listener with the name “resolve_cache_dns_listener” and the IP address “192.168.2.107” and the DNS profile “resolver_cache_dns_profile”.

create DNS Listener with Rsolver Cache DNS Profile
create DNS Listener with Rsolver Cache DNS Profile

Test DNS Resolver Cache Operation

To test the DNS resolver cache, we query the new listener with the IP address “192.168.2.107” via nslookup.
For example, we query the name “f5.com”. If you query the same name twice, you will notice that the second time you get the answer faster than the first time, this is due to the F5 DNS cache.
Notice that when you use nslookup to query a name, local client cache will not be used. If you get the DNS response faster the second time, it is due to the DNS server cache and not the client cache.

query Resolver Cache DNS listener with nslookup
query Resolver Cache DNS listener with nslookup

To view the contents of the F5 DNS cache, you can use the command “show ltm dns cache records rrset cache dns_resolver_cache” in “tmsh” environment, where “dns_resolver_cache” is the name of the resolver cache that we just created.

check F5 DNS resolver cache
check F5 DNS resolver cache

you can also delete the content of DNS cache using “delete ltm dns cache records rrset cache dns_resolver_cache”.

delete F5 DNS resolver cache
delete F5 DNS resolver cache
Back to: F5 BIG-IP DNS (in progress) > F5 DNS to speed up the DNS process

Leave a Reply

Your email address will not be published. Required fields are marked *


Post comment