FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
nithincs
Staff
Staff
Article Id 383591
Description This article describes how to use the DNS filter profile to filter and minimize Internet usage by interrupting client DNS queries.
Scope FortiGate
Solution

Internet access to the different network segments is restricted by using security profiles such as web filters and application control.


This security feature uses WAD and IPS engine processes to decrypt and inspect the communication, which is FortiGate resources consuming, and also blocks the communication post-inspection of the encrypted traffic.

Since web filter and DNS filter domain categories are similar, DNS filter can be used to block unwanted, non-productive, or untrusted domain access at the client DNS lookup itself.


This will reduce the load on the FortiGate by blocking web access at DNS lookup and allowing only necessary domains to be further inspected by the other UTM profiles.

 

The common approach of DNSfilter profile in FortiGate policies.

 

Scenario 1:

All the client machines are configured with a public DNS server.
Create user/different network segment security policies and apply the DNS filter with necessary categories being blocked as per security and access restrictions for the segment.

 

For example:

 

There are two different network segments, LAN and WIFI, allowed to access the internet with different access restrictions:

  • LAN user's DNS filter profile is configured with Pre-configured filters: PG-13
  • WI-FI user DNS filter profile is configured with Pre-configured filters: G

 

LAN_users.JPG

 

wifi_users.JPG

 

The respective DNS filter profile is called in the LAN to WAN and WIFI to WAN policy.

 

s1.JPG

 

Now DNSFilter blocks domain access for the LAN and WIFI users based on domain categories blocked in the respective DNSfilter profile.

 

 

Scenario 2:

All the client machines are configured with a local DNS server and the DNS server is using Public DNS as a forward DNS server.

In this case, the DNS filter should be applied in the client-to-local DNS server policy and not in the DNS server to the Internet or Forward DNS server IP policy.

 

This is because if DNSFilter is applied in the local DNS server to the internet policy, then the action set for the FortiGuard Category in the applied DNSFilter will be applicable for all the DNS communication between them.
If the category is blocked, the DNS response from the forward DNS server will get modified to 'Redirect Portal IP'.The 

 

The DNS server will cache this DNS response and also resolve the respective domain name to "Redirect Portal IP" for all the users. With this, it will not be possible to achieve different security and access restrictions for the different users.

 

The best approach in this scenario is to create user/different network segment security policies and apply the DNS filter with necessary categories being blocked as per security and access restrictions for the segment.
With different DNSfilter profiles applied on the user's network to local DNS server policies, FortiGate will replace the domain address to 'Redirect Portal IP' for the specific domain based on the action set in dnsfilter applied in the matching policy.


Local DNS server to Forward DNS server communication is not interrupted, and the local DNS server will keep the actual domain address in the cache.

 

For example:

 

s2.JPG

 

Policy ID 2 allows DNS communication from local DNS to the Forward DNS server; no DNSfilter is applied here to avoid DNS cache of the local DNS server being updated with 'Redirect Portal IP'.

Policy 5 and 6, created for LAN network to DNS server and WIFI network to DNS server communication, and respective DNSfilter profile is applied. 

If the DNS filter is not blocking the access, then policies 6 and 7 will allow the client to connect the domain/website which is further inspected by other UTM profiles.