In this article
A MikroTik RouterOS router can send all network DNS queries to DNSFilter over DNS over HTTPS. Every device behind the router is filtered and reported as one Clientless deployment, without a Roaming Client installed on each one. Clientless filtering is available on Plus plans and above.
RouterOS accepts the full DNS over HTTPS (DoH) address, including the path that identifies the deployment, so traffic reports against this deployment rather than against other networks.
These steps are general guidance, and DNSFilter does not officially endorse or validate third-party software. Test the configuration before deploying it, and consult MikroTik for settings specific to the router.
Prerequisites
Clientless DNS filtering on MikroTik RouterOS requires:
- RouterOS v7 and higher
- Access to the router through WinBox, WebFig, or SSH
- A DNSFilter dashboard role other than read-only or policy-only
- For networks that filter outbound traffic: outbound TCP 443 from the router to
103.247.36.150and103.247.37.150, so the router can reach DNSFilter - Block Page on HTTPS websites: blocked HTTPS sites show a certificate warning instead of the Block Page unless the DNSFilter SSL/TLS certificates are installed on each device on the network.
Step 1: Create the Clientless deployment
To create a Clientless deployment for a MikroTik router:
- From the DNSFilter dashboard, navigate to Deployments > Clientless.
- Select Add Clientless Device.
- Enter the deployment details:
- Organization (MSP dashboard only): the Organization the Clientless Device belongs to
- Name: a name for the Clientless Device, which cannot be changed after the deployment is created
- Site: the Site the deployment connects to
- Policy/Schedule: leave as Inherit from Site, or select a different policy or schedule
- Block Page: leave as Inherit from Site, or select a different block page
- From DoH Type, select URL.
- Select Generate DoH Endpoint.
- Copy the DoH address.
The DoH address has the form https://doh.dnsfilter.com/<unique-id>, and the unique ID identifies the deployment. If the address is altered or trimmed, DNS stops working for the network.
Step 2: Add bootstrap entries for the DNSFilter address
Caution: Add the bootstrap entries before setting the DoH server. Without them, the network goes offline.
After DoH is active, RouterOS uses DoH for all name resolution, including the lookup of the DNSFilter address itself. Static entries for doh.dnsfilter.com provide RouterOS with DNSFilter's IP addresses, which breaks the circular dependency.
To add the bootstrap entries on a MikroTik router, run the following commands:
/ip dns static add name=doh.dnsfilter.com address=103.247.36.150 ttl=1d /ip dns static add name=doh.dnsfilter.com address=103.247.37.150 ttl=1d
Step 3: Set the Clientless address as the DoH server
Caution: RouterOS accepts a DoH address that does not work and does not fall back to unencrypted DNS. A wrong address stops resolution for the whole network until the address is corrected and the cache is cleared.
To set the Clientless address as the DoH server on a MikroTik router:
-
Run the following command, replacing the address with the DoH address copied from DNSFilter. Enter the address exactly as shown, including the
https://prefix and everything after the final slash:/ip dns set use-doh-server="https://doh.dnsfilter.com/<unique-id>" verify-doh-cert=yes
On RouterOS v7.20.2,
verify-doh-cert=yesverifies DNSFilter's certificate without a root certificate import. If a build behaves differently, follow MikroTik's certificate import instructions. -
Clear the DNS cache with the following command:
/ip dns cache flush
Do not remove other DNS servers until the deployment is confirmed.
Clientless DNS filtering is active when queries for this deployment appear in Reporting > DNS Query Log, under Clientless in the Deployments filter.
Comments
0 comments
Please sign in to leave a comment.