Troubleshooting for DNS filter
If you have trouble with the DNS Filter profile in your policy, start with the following troubleshooting steps:
- Check the connection between FortiGate and FortiGuard DNS rating server (SDNS server).
- Check that FortiGate has a valid FortiGuard Web Filter license.
- Check the FortiGate DNS Filter configuration.
Troubleshooting connection between FortiGate and FortiGuard SDNS server
Ensure FortiGate can connect to the FortiGuard SDNS server. By default, FortiGate uses UDP port 53 to connect to the SDNS server.
To check the connection between FortiGate and the SDNS server in the CLI:
- In the CLI Console, run the
diagnose test application dnsproxy 3
command to find the FortiGuard SDNS server.... FDG_SERVER:208.91.112.220:53 FGD_CATEGORY_VERSION:8 SERVER_LDB: gid=6f00, tz=-420, error_allow=0 FGD_REDIR:208.91.112.55
- Check the
FDG_SERVER
line. The SDNS server IP address might be different depending on location. For this example, it is:FDG_SERVER:208.91.112.220:53
- In the CLI Console under the management VDOM, run the command
execute ping 208.91.112.220
to check the communication between the FortiGate and the SDNS server. - Optionally, you can also check the communication using a PC on the internal network.
- Disable the DNS Filter profile so that it does not affect your connection check.
- Ping your ISP or a public DNS service provides's DNS server, for example, Google's public DNS server of 8.8.8.8:
#dig @8.8.8.8 www.fortinet.com
Or specify the SDNS server as DNS server:
#dig @208.91.112.220 www.fortinet.com
- Check that you can get domain www.fortinet.com A record from the DNS server which shows that UDP port 53 connection path is not blocked.
#dig @8.8.8.8 www.fortinet.com ;; ->>HEADER<<- opcode: QUERY; status: NOERROR; id: 35121 ;; Flags: qr rd ra; QUERY: 1; ANSWER: 3; AUTHORITY: 0; ADDITIONAL: 0 ;; QUESTION SECTION: ;; www.fortinet.com. IN A ;; ANSWER SECTION: www.fortinet.com. 289 IN CNAME fortinet-prod4-858839915.us-west-1.elb.amazonaws.com. fortinet-prod4-858839915.us-west-1.elb.amazonaws.com. 51 IN A 52.8.142.247 fortinet-prod4-858839915.us-west-1.elb.amazonaws.com. 51 IN A 13.56.55.78 ;; Received 129 B ;; Time 2019-04-29 14:13:18 PDT ;; From 8.8.8.8@53(UDP) in 13.2 ms
Checking FortiGuard DNS Rating Service license
The FortiGuard DNS Rating Service shares the license with FortiGuard Web Filter so you must have a valid Web Filter license for the DNS Rating Service to work. While the license is shared, the DNS Rating Service uses a separate connection mechanism from the Web Filter Rating.
To check the DNS Rating Service license in the CLI:
- In the CLI Console, run the command
diagnose test application dnsproxy 3
. - Look for the
LICENSE
line and check that the license has not expired, for example:LICENSE: expiry=2029-08-21, expired=0, type=2
- Check the
dns-server
lines. Somedns-server
lines showsecure=1 ready=1
. These lines show the functioning SDNS servers. For example:dns-server:208.91.112.220:53 tz=-480 req=7 to=0 res=7 rt=1 secure=1 ready=1 timer=0 probe=0 failure=0 last_failed=0
Checking FortiGate DNS Filter profile configuration
To check the FortiGate DNS Filter profile configuration:
- Create a local domain filter and set the Action to Redirect to Block Portal.
See Local domain filter.
- Apply this DNS Filter profile to the policy.
- From the client PC, DNS query this domain.
If you get the profile's redirected portal address, that shows that the DNS Filter profile works as expected.
More troubleshooting steps
To reload the DNS proxy in the CLI:
(global)#diagnose test application dnsproxy 99
To debug DNS proxy details:
These commands might create more output in your console.
#diagnose debug application dnsproxy -1 #diagnose debug enable/disable
DNS proxy command reference
Use the following diagnose test application dnsproxy
command line options to check DNS proxy status and help with troubleshooting.
(global) # diagnose test application dnsproxy ?
worker idx: 0
1. Clear DNS cache
2. Show stats
3. Dump DNS setting
4. Reload FQDN
5. Requery FQDN
6. Dump FQDN
7. Dump DNS cache
8. Dump DNS DB
9. Reload DNS DB
10. Dump secure DNS policy/profile
11. Dump Botnet domain
12. Reload Secure DNS setting
13. Show Hostname cache
14. Clear Hostname cache
15. Show SDNS rating cache
16. Clear SDNS rating cache
17. DNS debug bit mask
99. Restart dnsproxy worker