| Description | This article describes how FortiGate processes DNS queries when DNS cache is available and how the behavior changes before and after the dns-cache-ttl timer expires. It also covers how to verify the DNS query flow using CLI commands and packet captures. |
||||||||||||
| Scope | FortiGate. | ||||||||||||
| Solution |
FortiGate maintains an internal DNS cache whenever DNS queries pass through the unit.
The following sections describe the query flow, how to monitor it, and how to validate it with packet captures.
Configuration:
To speed up verification during testing, the dns-cache-ttl value is reduced to 60 seconds:
config system dns set primary 96.45.45.45 set secondary 96.45.46.46 set dns-cache-ttl 60 end
Test scenario:
FortiGate receives the query, forwards it to the DNS servers configured under system.dns, and then caches the returned response.
Verify DNS cache on the FortiGate:
The TTL field consists of three values in the following format :
<DNS TTL> : <Remaining FortiGate cache TTL> : <dns-cache-ttl>
In this case:
PC2 sends a DNS query for the same domain 'naver.com'; two behaviors can occur depending on the cache status When dns-cache-ttl has NOT expired:
This can be confirmed via packet capture:
When dns-cache-ttl HAS expired:
Packet capture will show:
Expected observations:
Summary:
|
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.