Troubleshooting for DNS filter

If you have trouble with the DNS filter profile in your policy, start with the following troubleshooting steps:

Checking the connection between the FortiGate and FortiGuard SDNS server

You need to ensure the FortiGate can connect to the FortiGuard SDNS server. By default, the FortiGate uses UDP port 53 to connect to the SDNS server.

To check the connection between the FortiGate and SDNS server:
  1. Verify the FortiGuard SDNS server information:

    # diagnose test application dnsproxy 3
    ...
    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

    The SDNS server IP address might be different depending on location (in this example, it is 208.91.112.220:53).

  2. In the management VDOM, check the communication between the FortiGate and the SDNS server:

    #execute ping 208.91.112.220
  3. Optionally, you can check the communication using a PC on the internal network (this example uses dig).

    1. Disable the DNS filter profile so that it does not affect your connection check.

    2. Ping your ISP or a public DNS service provider'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 a DNS server:

      #dig @208.91.112.220 www.fortinet.com
    3. Verify that you can get a domain www.fortinet.com A record from the DNS server. This shows that the 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 the FortiGuard DNS rating service license

The FortiGuard DNS rating service shares the license with the FortiGuard web filter, so you must have a valid web filter license for the DNS rat