Courseiva
NSE4Chapter 8 of 14Objective 4.3

DNS Filtering and Authentication Policies

DNS filtering and authentication policies are two essential layers of defence that stop malicious websites from reaching you and control who gets access to your network. For the NSE4 exam, you must understand how Fortinet's FortiGate firewall uses these tools to enforce security at the domain name level and to verify user and device identities before granting network access. Mastering these concepts is critical because they appear in multiple exam domains and are a foundation for building a secure network perimeter.

12 min read
Intermediate
Updated Jul 24, 2026
Editorial oversight: Johnson Ajibi· Security Systems Architect · MSc IT Security · IEEE Senior Member

A simple way to picture DNS Filtering and Authentication Policies

The Airport Security and Staff Badge Analogy

An airport is a busy network of terminals, gates, and passengers. The airport's main directory, the flight information display system, is its DNS server — it translates a passenger's destination (a website name like 'shop.example.com') into a specific gate number (the IP address). DNS filtering is like the airport's security team pre-screening every flight destination against a 'No-Fly List'. When a passenger tries to check in for a flight to a known dangerous location (a malicious domain), the system automatically blocks the booking and cancels the ticket before the passenger even reaches the gate. This stops harmful passengers (malware) from ever boarding the plane and entering the secure zone (the corporate network).

Authentication policies are the airport's staff badge system. Every employee — from the pilot to the baggage handler — must tap their personalised badge at a card reader before passing through a door into a restricted area. The badge reader (the firewall) checks two things: is this a valid badge (user identity), and does this badge have permission to enter this specific area (device identity and group membership)? A pilot can enter the cockpit, but a baggage handler cannot. If a badge is stolen, the security team can revoke it instantly, locking the thief out of every door. Together, DNS filtering blocks the threat from arriving, while authentication policies control exactly who goes where inside the airport once they are there.

How It Actually Works

Let us start with the fundamentals, assuming you have never configured a firewall in your life. The internet works because of a system called the Domain Name System (DNS). Think of DNS as the phonebook of the internet. When you type a website address like 'www.example.com' into your browser, your computer does not know where that website lives. It asks a DNS server: 'What is the IP address for www.example.com?' The DNS server replies with a number, such as 192.0.2.1. Your computer then uses that number to connect to the website. Without DNS, you would have to memorise long strings of numbers for every site you visit.

DNS filtering is a security feature that sits in the middle of this conversation. When your computer asks the DNS server for an address, the FortiGate firewall (or a dedicated DNS filter service) checks the requested domain name against a database of known malicious or categorised sites. This database is maintained by FortiGuard, Fortinet's threat intelligence service. If the domain is on a blocklist — for example, a known phishing site that tries to steal your passwords, or a domain that distributes ransomware — the firewall intercepts the DNS request and returns a block page instead of the real IP address. Your browser never connects to the dangerous server.

DNS filtering can also block entire categories of websites. For example, an organisation might block all gambling, adult content, or social media sites during work hours. The filtering decision is based on the domain name alone, which makes it very fast and efficient. It works even if the website's IP address changes, because the domain name stays the same. This is a key advantage over traditional IP-based blocking.

Now, let us move to authentication policies. A network without authentication is like a building with no locks on the doors. Anyone who can physically reach the network cable or connect to the Wi-Fi can access everything. Authentication policies solve this by requiring a user or device to prove its identity before it can use the network. The FortiGate firewall supports several authentication methods, including local password databases, LDAP (Lightweight Directory Access Protocol, which connects to a central user directory like Microsoft Entra ID), RADIUS (Remote Authentication Dial-In User Service, often used for Wi-Fi and VPN access), and single sign-on (SSO) systems.

When a user tries to access a resource, the firewall checks if the user is already authenticated. If not, it presents a captive portal — a login page that the user must complete with credentials. Once authenticated, the firewall creates a 'user identity' entry that links the user's IP address to their username and group memberships. This identity is then used by firewall policies to permit or deny traffic based on who the user is, not just where they are connecting from. For example, a policy might allow the finance team's members to reach the accounting server, but block everyone else.

Device identity works similarly but focuses on the device itself rather than the person. The firewall can check a device's operating system, hostname, MAC address, or a certificate installed on the device. This is especially important for allowing only company-issued laptops onto the corporate network while blocking personal devices. Fortinet calls this feature 'device identification' and it can be integrated with FortiClient, an endpoint security agent installed on user machines.

Why do these two technologies exist together? Because they solve different problems. DNS filtering is proactive: it prevents users from even attempting to reach dangerous destinations. Authentication policies are reactive to access: they control what an authenticated user is allowed to do once they are inside the network. A typical FortiGate security policy will combine both: first, DNS filtering blocks the request if the domain is malicious, and second, if the domain is safe, the policy checks the user's authentication status and applies the appropriate rules.

Flowchart showing how a DNS query is filtered by the FortiGate, then proceeds to authentication and device identity checks before traffic is allowed.

Walk-Through

1

Enable the DNS Filter Profile

In the FortiGate web interface, go to Security Profiles and select DNS Filter. Create a new profile or edit an existing one. Here you choose which FortiGuard categories to block (e.g., Malicious, Phishing, Spam URLs). You also decide the action when a domain is blocked — either 'block' to deny access or 'redirect' to show a warning page. This profile is the rulebook that tells the firewall which domains are dangerous.

2

Create a Firewall Policy and Attach the DNS Filter

Navigate to Policy & Objects and create a new firewall policy. Define the source (e.g., internal network) and destination (e.g., internet). Under Security Profiles, enable the DNS Filter profile you created. This attaches the filtering rules to all traffic that matches this policy. Without this step, the DNS filter profile is not used.

3

Configure Authentication Settings for LDAP or RADIUS

Go to User & Authentication and add a new LDAP or RADIUS server. Enter the server address, port (usually 389 for LDAP, 636 for LDAPS), and the base distinguished name (the starting point in the directory, like 'dc=company,dc=com'). This connects the FortiGate to your user directory, allowing it to verify usernames and passwords against the central database.

4

Define User Groups and Link Them to Policies

Under User & Authentication, create a user group (e.g., 'Finance_Group') and add the LDAP server as the remote group source. Then, in the firewall policy, under Source, select 'User Group' and choose the group you created. Now, only users who are members of that Active Directory group in your LDAP server will be allowed by this policy.

5

Enable Device Identity with FortiClient

Install FortiClient on user devices. On the FortiGate, go to Security Profiles and enable Device Identification. Create a new device group or use a predefined one. In the firewall policy, under Source, add a condition for 'Device Type' or 'Device Certificate'. This ensures that only registered devices with the correct identity credentials are allowed through the policy.

6

Test and Verify the Configuration

From a test client that is not registered with FortiClient, try to access a known blocked domain (you can use a test URL provided by Fortinet or a category you blocked). Verify that DNS filtering returns a block page. Then, log in with a valid user account and try to access a resource restricted by a policy. Confirm that authentication and device identity checks work as expected. Review logs in Log & Report to see any blocks or authentication failures.

What This Looks Like on the Job

An IT professional working for a mid-sized company of 500 employees is tasked with implementing a security solution on a FortiGate firewall. The company has recently experienced a ransomware attack that started when an employee clicked a link in a phishing email that led to a malicious download site. The IT professional's goal is to prevent this from happening again and to restrict access to sensitive financial systems.

Step one: the IT professional enables DNS filtering on the FortiGate. They log into the firewall's web interface and navigate to the DNS filter profile settings. They select the FortiGuard category-based filter and choose to block several categories: 'Malicious Websites', 'Phishing', 'Spam URLs', and 'Recently Registered Domains'. The last category is particularly important because attackers often register fresh domains that have no reputation yet. By blocking domains registered in the last 30 days, the IT professional stops many emerging threats.

Step two: they configure the DNS filter to redirect blocked requests to a custom block page that tells the user the site is categorised as malicious. They also enable logging so that every blocked attempt is recorded. The logs allow the IT professional to see which users are clicking suspicious links and to provide additional training if needed.

Step three: the IT professional turns to authentication policies. The company uses Microsoft Entra ID for user accounts. The IT professional configures the FortiGate to authenticate users against Microsoft Entra ID using LDAP. They create a user group called 'Finance_Users' and a separate group called 'HR_Users'. They then create firewall policies that specifically allow only members of the Finance_Users group to access the IP address of the accounting server. Any user not in that group gets a 'deny' message.

Step four: they enable device identification by installing FortiClient on every company laptop. FortiClient sends a fingerprint of the device (including its hostname, OS version, and installed certificates) to the FortiGate. The IT professional creates a policy that says: only devices with a valid Fortinet certificate and a hostname matching the company naming convention can access the internal file server. Any personal device or unrecognised laptop is automatically quarantined to a guest network with internet-only access.

Step five: the IT professional tests the setup. They connect a test laptop that is not enrolled with FortiClient and try to access the file server. The firewall blocks the connection because the device identity does not match. They then connect a company laptop, log in with a finance user's credentials, and attempt to browse to a known malicious test domain. The DNS filter intercepts the request and shows the block page. The test laptop is also unable to access the accounting server because the user is not in the Finance_Users group. The IT professional has now successfully implemented a layered defence that blocks malicious domains at the DNS level and enforces user and device identity checks at the policy level.

How NSE4 Actually Tests This

The NSE4 exam tests DNS filtering and authentication policies heavily because they are core features of the FortiGate firewall. You should expect approximately 8-12 questions on these topics across the exam. The questions fall into several distinct patterns.

First, the exam loves to test your understanding of how DNS filtering is configured and what happens when a DNS request is blocked. A typical question might present a scenario where users cannot access a legitimate website after enabling DNS filtering. The correct answer is often that the website's domain is being blocked because it falls into a filter category that was accidentally enabled — for example, 'General Business' or 'Information Technology' — both of which contain many legitimate sites. The trap is that beginners often assume the issue is a routing problem or a firewall policy misconfiguration, when in fact it is a DNS filter category.

Second, the exam frequently asks about the difference between DNS filtering and web filtering. DNS filtering blocks the initial DNS query, so the connection never starts. Web filtering (or application control) inspects the content of the web traffic after the connection is established. The exam expects you to recognise that DNS filtering is more efficient because it blocks the connection before any data is sent, but it is also less granular — it cannot block specific pages within a domain, only the whole domain.

Third, authentication policy questions often involve captive portal configuration and LDAP integration. A common trap question: 'A user can connect to the FortiGate's captive portal but is not prompted for credentials. What is the most likely cause?' The answer is usually that the user already has a valid session cookie from a previous authentication, or that the firewall policy is set to 'allow' without requiring authentication for that particular source IP. The exam wants you to know that captive portal authentication is triggered by a firewall policy that has 'identity-based' or 'user-aware' options enabled.

Fourth, device identity questions test your understanding of FortiClient and how the firewall recognises devices. The exam may ask which component provides the device fingerprint. The answer is FortiClient, which sends a 'device identity' packet to the FortiGate. A trap is suggesting that the device's MAC address alone is sufficient, because MAC addresses can be spoofed and are not considered a strong identity proof.

Fifth, the exam tests the relationship between DNS filtering and security profiles. You must know that DNS filtering is a separate profile from web filtering and antivirus profiles, and that all three can be applied in the same firewall policy. The correct order of operations in a FortiGate is: first, DNS filtering checks the domain; second, if allowed, web filtering and application control inspect the content; third, antivirus scans the files. The exam may ask you to order these steps correctly.

Key definitions to memorise:

FortiGuard: Fortinet's cloud-based security service that provides threat intelligence for DNS filtering, web filtering, and antivirus.

DNS filter profile: a set of rules that define which domains to allow or block based on categories or custom lists.

Captive portal: a web page that prompts users for authentication before granting network access.

LDAP: Lightweight Directory Access Protocol, a standard for querying and modifying directory services like Microsoft Entra ID.

Device identification: the process of recognising a device based on its unique characteristics, often provided by FortiClient.

Key Takeaways

DNS filtering blocks malicious domains at the DNS query stage, preventing the connection from ever starting.

Authentication policies on FortiGate allow you to control network access based on who the user is, not just where they connect from.

Device identity, often provided by FortiClient, uses certificates or fingerprints to verify the device itself, not just the user.

FortiGuard categories are pre-defined lists that let you block entire classes of websites, such as phishing, malware, or gambling, with a single configuration.

A captive portal is the login page that users see when they need to authenticate before accessing the network.

DNS filtering and authentication policies are applied separately within a firewall policy and can work together in the same policy for layered security.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

DNS Filtering

Blocks at the DNS query stage, before any connection is made

Blocks entire domains based on category or custom list

Relies on FortiGuard category database for domain reputation

Web Filtering

Inspects HTTP/HTTPS traffic after the connection is established

Can block specific pages, URLs, or content types within a domain

Uses FortiGuard URL ratings and can scan page content

User Authentication

Identifies the person using credentials (username/password)

Credentials are validated against LDAP, RADIUS, or local database

User can log in from any device

Device Identity

Identifies the machine using certificates, hostname, or fingerprint

Device fingerprint is provided by FortiClient agent

Device is bound to the network regardless of who is using it

Captive Portal

Presents a web login page when user tries to access the network

User must enter credentials manually each session

Typically used for guest Wi-Fi or new user access

Pre-authentication

Uses existing session cookies or SSO to skip manual login

User is automatically authenticated based on prior login or machine credentials

Common in corporate environments with domain-joined computers

DNS Override (Allowlist)

Manually added domains that are always allowed, even if category is blocked

Used to fix false positives where a legitimate domain is blocked

Higher priority than category-based rules

DNS Override (Blocklist)

Manually added domains that are always blocked, even if category is allowed

Used to block specific dangerous domains within an otherwise safe category

Higher priority than category-based rules

Watch Out for These

Mistake

DNS filtering blocks all traffic from a malicious IP address, so it is the same as an IP blocklist.

Correct

DNS filtering blocks based on the domain name, not the IP address. A single IP address can host multiple domains, and malicious domains can change IP addresses frequently. DNS filtering remains effective because it checks the name before the IP lookup.

Beginners confuse the layer at which the blocking occurs. They think DNS is just another name for IP, but DNS filters work at the name resolution stage, before any IP connection is made.

Mistake

If a user is already authenticated for one service, they are automatically authenticated for all firewall policies on the FortiGate.

Correct

Authentication is per-policy. A user may be logged into a captive portal for internet access, but that does not grant them access to a separate firewall policy that protects the finance server. Each policy has its own authentication requirement.

People assume that authentication works like a single sign-on system across all resources, but FortiGate policies are independent unless configured with SSO in a specific way.

Mistake

Device identification using a MAC address is just as secure as using a certificate.

Correct

MAC addresses can be easily spoofed using software settings. Certificates are cryptographically signed and cannot be duplicated without access to the private key, making them far more secure for device identity.

Many beginners think MAC addresses are hardware-burned and immutable, but modern operating systems allow MAC spoofing easily.

Mistake

DNS filtering can block specific pages within a website, like blocking the login page but allowing the homepage.

Correct

DNS filtering blocks entire domains. It cannot differentiate between pages on the same domain. Blocking a domain (e.g., 'example.com') blocks all pages under it. To block specific pages, you need web filtering.

Learners confuse the capabilities of DNS-level filtering with application-layer filtering. They expect granular control from a simpler technology.

Mistake

Once DNS filtering is enabled, all internet traffic is automatically filtered through it.

Correct

DNS filtering only applies to traffic that goes through the FortiGate's DNS proxy or when the firewall policy has a DNS filter profile attached. Traffic that uses a different DNS server (e.g., a public DNS like 8.8.8.8) bypasses the filter unless explicitly redirected.

Users assume that enabling a feature in one place applies it globally, but FortiGate requires explicit policy attachments for security profiles.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

Does DNS filtering slow down my internet?

No, DNS filtering adds only a few milliseconds because the firewall checks the domain name against a local cache of FortiGuard categories. The query is much faster than downloading the actual web page.

Can I use DNS filtering to block specific pages on a site, like the admin login?

No, DNS filtering blocks whole domains. To block specific pages, you need web filtering, which inspects the URL path after the DNS resolution.

What happens if a legitimate website is accidentally blocked by DNS filtering?

You can add the domain to a local allowlist in the DNS filter profile. It will then be permitted even if it matches a blocked category. Also, you can adjust the category settings to unblock the whole category.

How do I force users to authenticate before they can access the internet?

Configure a captive portal on the FortiGate by creating a firewall policy that has authentication enabled under the 'Authentication' tab. The user will see a login page when they open their browser.

What is the difference between user authentication and device identity?

User authentication identifies the person using a username and password. Device identity identifies the machine itself using certificates or fingerprints. Both can be required in a single policy.

Can I block a domain but allow a subdomain, like block 'example.com' but allow 'mail.example.com'?

Yes, in the DNS filter profile you can create a custom allowlist entry for the subdomain. The FortiGate checks the more specific entry first, so 'mail.example.com' will be allowed even if 'example.com' is blocked.

Terms Worth Knowing

Keep going

You've finished DNS Filtering and Authentication Policies. Continue through the NSE4 study guide to build a complete picture of the exam.

Done with this chapter?