# Mikrotik Router Setup

#### **Router with Static IP address configuration**

  
Go to SafeDNS **Dashboard &gt; Settings &gt; Devices** and copy your IP address to the "**IP addresses / DynDNS**" box, choose a policy, and click "**Add**".

[![Screenshot_124.png](https://docs.safedns.com/uploads/images/gallery/2024-08/scaled-1680-/3VPJFjBDwGYLqVXE-screenshot-124.png)](https://docs.safedns.com/uploads/images/gallery/2024-08/3VPJFjBDwGYLqVXE-screenshot-124.png)

2\. Change your router’s DNS servers to SafeDNS addresses - **195.46.39.39** and **195.46.39.40**  
To do that, open the configuration page of the Mikrotik router, and browse the following option:  
Menu &gt; IP &gt;DHCP Server &gt; Networks

[![image-1679334312313.png](https://docs.safedns.com/uploads/images/gallery/2023-03/scaled-1680-/SjvZhBZ84aF1KCre-image-1679334312313.png)](https://docs.safedns.com/uploads/images/gallery/2023-03/SjvZhBZ84aF1KCre-image-1679334312313.png)

3\. Select the “Network” used by the DHCP server and change/add the SafeDNS addresses - 195.46.39.39 and 195.46.39.40. Replace the DNS servers if there was configured any:

[![image-1679334344734.png](https://docs.safedns.com/uploads/images/gallery/2023-03/scaled-1680-/e2rSJDnY8MHSxFBx-image-1679334344734.png)](https://docs.safedns.com/uploads/images/gallery/2023-03/e2rSJDnY8MHSxFBx-image-1679334344734.png)

**You have successfully configured your router.**

<p class="callout warning">Please note that settings take 5-7 minutes to apply.  
Stats and filtering status update every 10 minutes.  
</p>

---

#### **Router with Dynamic IP address configuration**

Mikrotik Routers has the embedded feature of the Dynamic DNS setup named VPN Access.  
It can be activated easily from the router with no configuration needed on any DDNS service.

1\. Open the main page of the router – the Quick Set Menu and scroll down to the VPN setup:

[![image-1679334382392.png](https://docs.safedns.com/uploads/images/gallery/2023-03/scaled-1680-/g0r2HATD0nRUuhT9-image-1679334382392.png)](https://docs.safedns.com/uploads/images/gallery/2023-03/g0r2HATD0nRUuhT9-image-1679334382392.png)

2\. Activate the VPN access and set the VPN Password. Click the button Apply Configuration in order to save and activate the settings. Copy the VPN address to the clipboard.

3\. Go to SafeDNS Dashboard &gt; Settings &gt; Devices paste the VPN address the "IP addresses / DynDNS" box, choose a policy, and click "Add".

[![1.routermikro.png](https://docs.safedns.com/uploads/images/gallery/2024-08/scaled-1680-/NvAUzR1gP8EqSy4I-1-routermikro.png)](https://docs.safedns.com/uploads/images/gallery/2024-08/NvAUzR1gP8EqSy4I-1-routermikro.png)

Once added, you will see it in the DynDNS section of the Dashboard.

[![2.routermikrotik.png](https://docs.safedns.com/uploads/images/gallery/2024-08/scaled-1680-/3arzLM4MOk3g9K9p-2-routermikrotik.png)](https://docs.safedns.com/uploads/images/gallery/2024-08/3arzLM4MOk3g9K9p-2-routermikrotik.png)

4\. Change your router’s DNS servers to SafeDNS addresses - **195.46.39.39** and **195.46.39.40**  
To do that, open the configuration page of the Mikrotik router, and browse the following option:  
Menu &gt; IP &gt;DHCP Server &gt; Networks

[![image-1679334312313.png](https://docs.safedns.com/uploads/images/gallery/2023-03/scaled-1680-/SjvZhBZ84aF1KCre-image-1679334312313.png)](https://docs.safedns.com/uploads/images/gallery/2023-03/SjvZhBZ84aF1KCre-image-1679334312313.png)

5\. Select the “Network” used by the DHCP server and change/add the SafeDNS addresses - 195.46.39.39 and 195.46.39.40. Replace the DNS servers if there was configured any:

[![image-1679334344734.png](https://docs.safedns.com/uploads/images/gallery/2023-03/scaled-1680-/e2rSJDnY8MHSxFBx-image-1679334344734.png)](https://docs.safedns.com/uploads/images/gallery/2023-03/e2rSJDnY8MHSxFBx-image-1679334344734.png)

**You have successfully configured your router.**

<p class="callout warning">Please note that settings take 5-7 minutes to apply.  
Stats and filtering status update every 10 minutes.  
</p>

---

#### DoH setup

<p class="callout warning">DoH is supported on all paid plans.  
DoH links with policy are available on Education &amp; Non-Profit, Pro, and Pro Plus plans only.  
</p>

MikroTik router allows to set up DoH connection to SafeDNS.

##### DoH link without policy

With this setup, all devices connected to the network with IP address added in the SafeDNS Dashboard will be filtered with the selected policy.   
If IP address of the router is changed, you need to add a new IP address in the SafeDNS Dashboard.

Navigate to SafeDNS **Dashboard &gt; Settings &gt; Devices**, copy your IP address to the "**IP addresses/DynDNS**" box, choose a policy, and click "**Add**".

[![Screenshot_124.png](https://docs.safedns.com/uploads/images/gallery/2024-08/scaled-1680-/3VPJFjBDwGYLqVXE-screenshot-124.png)](https://docs.safedns.com/uploads/images/gallery/2024-08/3VPJFjBDwGYLqVXE-screenshot-124.png)

**In the MikroTik router:**  
1\. Navigate to **IP &gt; DNS**, enter "https://doh.safedns.com/" in the **Use DoH Server** field, untick **Verify DoH Certificate**, and save the changes.

[![Screenshot_126.png](https://docs.safedns.com/uploads/images/gallery/2024-08/scaled-1680-/RxbyVBdQ3FyInVB2-screenshot-126.png)](https://docs.safedns.com/uploads/images/gallery/2024-08/RxbyVBdQ3FyInVB2-screenshot-126.png)

  
DoH link with policy

With this setup, all devices connected to the router will be filtered with the selected policy.  
The Router is identified by the policy token in the link. If the IP address of the router changes, it will not affect the filtering.

1\. Navigate to SafeDNS **Dashboard &gt; Settings &gt; Policy**, and copy the DoH link with the policy.

[![Screenshot_127.png](https://docs.safedns.com/uploads/images/gallery/2024-08/scaled-1680-/wbt7FFzc2QoxvIDk-screenshot-127.png)](https://docs.safedns.com/uploads/images/gallery/2024-08/wbt7FFzc2QoxvIDk-screenshot-127.png)

2\. In the MikroTik router, navigate to **IP &gt; DNS**, enter the copied link in the **Use DoH Server** field, untick **Verify DoH Certificate**, and save the changes.

[![image-1760555725062.png](https://docs.safedns.com/uploads/images/gallery/2025-10/scaled-1680-/E75VaDzdDOQu6WcD-image-1760555725062.png)](https://docs.safedns.com/uploads/images/gallery/2025-10/E75VaDzdDOQu6WcD-image-1760555725062.png)

After that, all devices connected to the router will be filtered with the selected policy.