Let's say that I have 2 server rooms with one router in each room. This routers are…
- User
Let's say that I have 2 server rooms with one router in each room. This routers are fortinets. I'm using VPN to one of these router. These routers, they are connected via VPN tunnel and there are donnected in SD-WAN. I have setup DNS servers on these routers but sometimes, it doesn't resolve address defined in DNS.
- Assistant
Hi!
DNS hiccups on FortiGates that are tied together with an IP-sec VPN + SD-WAN almost always boil down to one (or a mix) of the following four areas:- Interface permissions (the box just refuses to listen/answer on the interface the query comes in on).
- The local DNS database / override configuration isn’t firing because the request is being forwarded instead of answered locally.
- SD-WAN policy or health-check is forcing the reply out a different interface (“asymmetric return”).
- Plain reachability / packet size / UDP-to-TCP fallback problems.
Below is a step-by-step way to isolate which one is biting you, the commands you can run on the FortiGates, and a couple of permanent fixes.
────────────────────────────────────────
- Are the FortiGates really acting as DNS servers? ──────────────────────────────────────── show system dns show system dns-database
• If you only see public resolvers (e.g. 8.8.8.8) in “system dns” then the FG doesn’t have a local database and will forward all queries.
• If you do have “config system dns-database” entries, confirm “set authoritative disable/enable” and the exact FQDNs you expect.
Quick test:
diag test application dnsproxy 6 example.local # substitute one of your hostnames diag test application dnsproxy 7 example.local # same, but forces an authoritative lookup
If test 6/7 instantly returns the A-record, your local database entry is good; if it times out, the FortiGate itself can’t see the record either → fix the database first.
──────────────────────────────────────── 2) Make sure the query is allowed to reach the FortiGate ──────────────────────────────────────── On every interface from which hosts will send DNS queries you must have:
config system interface edit set allowaccess ping https ssh fgfm dns next end
Without “dns” in allow-access the FortiGate silently drops packets to itself.
If your clients are behind an SD-WAN zone, add “set allowaccess dns” on all member interfaces that could be selected.──────────────────────────────────────── 3) Watch a live query cross the tunnel ──────────────────────────────────────── diag sniffer packet any 'host and port 53' 4
• Do you see the query leave the client interface and enter the IPSec tunnel interface (e.g. “vpn_to_siteB”)?
• Do you see a UDP reply returning, or do replies come back as TCP (big answer → fragmentation)?
• If you only see the query but never the answer, it’s an IPSec or SD-WAN reverse-path issue, go to step 4.Tip: If the answer comes back on a different interface (e.g. the FortiGate decides to exit via WAN2 instead of the IPSec bring-home path) the client will never get it. Remedy with a specific SD-WAN rule:
config sys sdwan config service edit 99 set name "DNS-from-siteA-clients" set dst "all" set protocol 17 # UDP set dst-port 53 set priority-members 1 # or the member that belongs to the IPSec tunnel next end end
──────────────────────────────────────── 4) Check session / flow debugging ──────────────────────────────────────── diag debug reset diag debug flow filter addr diag debug flow show function-name enable diag debug enable
Replay a failing nslookup, then Ctrl-C.
Common messages you’ll see:• deny: by static filter / local deny — allowaccess or policy problem
• no route — SD-WAN selected an interface that lacks a route back
• ttl expired / frag needed — large answer, enable DNS over TCP or increase MSS/MTU in phase1-interface──────────────────────────────────────── 5) Known “gotchas” & quick fixes ──────────────────────────────────────── A. Local override entries (single host records)
config system dns-database
edit "local-hosts"
set domain "mycorp.local"
set authoritative disable # leave off if you only want overrides
config dns-entry
edit 1
set hostname "filesrv"
set type A
set ip 10.10.10.50
next
end
next
endB. Cache too sticky / too short
config sys dns
set cache-ttl 300 # 5 min; set higher (1800) if answers drop when source flaps
endC. Fragmentation on IPSec
config vpn ipsec phase1-interface
edit "to-siteB"
set npu-offload enable
set add-route enable
set mtu 1430 # or whatever both sides can pass
next
endD. FortiOS bugs (DNS-proxy crashes < 7.0.11 / 7.2.5) – if you’re on an older build, upgrade.
──────────────────────────────────────── 6) If you still get intermittent failures, grab these details for deeper troubleshooting ────────────────────────────────────────
- FortiOS build number on both units
- Exact command output:
show system dns
show system dns-database - Sample client IP + the hostname that fails
- Result of: diag sniffer packet 'port 53' 4 while reproducing
Post those and we can dive further. 👍
Hope that gets the DNS gremlins out of your twin server rooms!
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.