Skip to content

DNS filtering

Secure Web Gateway allows you to inspect DNS traffic and control which websites users can visit.

1. Connect to Gateway

Connect devices

To filter DNS requests from an individual device such as a laptop or phone:

  1. Install the WARP client on your device.
  2. In the WARP client Settings, log in to your organization's Zero Trust instance.
  3. (Optional) If you want to display a custom block page, install a Cloudflare root certificate on your device.

Connect DNS locations

To filter DNS requests from a location such as an office or data center:

  1. Add the location to your Zero Trust settings.
  2. On your router, browser, or OS, forward DNS queries to the address shown in the location setup UI.

2. Verify device connectivity

To verify your device is connected to Zero Trust:

  1. In Zero Trust, go to Settings > Network.
  2. Under Gateway logging, enable activity logging for all DNS logs.
  3. On your device, open a browser and go to any website.
  4. In Zero Trust, go to Logs > Gateway > DNS.
  5. Make sure DNS queries from your device appear.

3. Create your first DNS policy

To create a new DNS policy:

  1. In Zero Trust, go to Gateway > Firewall policies.
  2. In the DNS tab, select Add a policy.
  3. Name the policy.
  4. Under Traffic, build a logical expression that defines the traffic you want to allow or block.
  5. Choose an Action to take when traffic matches the logical expression. For example, we recommend adding a policy to block all security categories:
    SelectorOperatorValueAction
    Security CategoriesinAll security risksBlock
  6. Select Create policy.

For more information, refer to DNS policies.

4. Add optional policies

Refer to our list of common DNS policies for other policies you may want to create.