# Peplink Router Setup

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

1\. 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&#95;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**:

1. Log in to the **Peplink Web Admin** interface.
2. Navigate to **Network &gt; WAN** and click on your active WAN connection.
3. Under **DNS Servers**, set the DNS assignment mode to custom/manual.
4. Enter the primary and secondary SafeDNS server addresses:  
    
    Primary DNS: **195.46.39.39**
    
    Secondary DNS: **195.46.39.40**
5. Click **Save** and **Apply Changes**.

**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**

Peplink routers have the built-in feature of the Dynamic DNS setup named **Find My Peplink**.  
It can be activated easily from the router with no configuration needed on any DDNS service.

<div class="attachment-container unknown md-has-block-component" id="bkmrk-1.open-device-detail"><div class="sequence-container" data-hveid="0" data-ved="0CAAQse0SahcKEwjn_vanzo-YAxUAAAAAHQAAAAAQNg" role="list"><div class="sequence-event ng-star-inserted" role="listitem"><div class="sequence-event-content"><div class="sequence-event-description gds-body-l md-content"><span class="only-show-to-message-actions" data-test-id="sequence-export-header">1. </span>Log into **InControl 2** portal, navigate to your organization/group, and click on your Peplink device to open its **Device Details** page.</div><div class="sequence-event-description gds-body-l md-content">2. Click the **Edit** button near the top-left corner.</div><div class="sequence-event-description gds-body-l md-content">3. <span class="only-show-to-message-actions" data-test-id="sequence-export-header"></span>Scroll down to **Find My Peplink Service** and toggle the switch to **On**.</div><div class="sequence-event-description gds-body-l md-content">4. <span class="only-show-to-message-actions" data-test-id="sequence-export-header"></span>Enter your preferred unique prefix for the <code>mypep&#46;link</code> address and click **Save**.</div></div></div></div></div>5\. Go to SafeDNS **Dashboard &gt; Settings &gt; Devices** and copy your DynDNS hostname to 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)

6\. Change your router’s DNS servers to SafeDNS addresses - **195.46.39.39** and **195.46.39.40**

1. Log in to the **Peplink Web Admin** interface.
2. Navigate to **Network &gt; WAN** and click on your active WAN connection.
3. Under **DNS Servers**, set the DNS assignment mode to custom/manual.
4. Enter the primary and secondary SafeDNS server addresses:  
    
    Primary DNS: **195.46.39.39**
    
    Secondary DNS: **195.46.39.40**
5. Click **Save** and **Apply Changes**.

**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 setting up the DoH connection to SafeDNS.

##### **DoH link without policy**

With this setup, all devices connected to the network with the IP address added in the SafeDNS Dashboard will be filtered with the selected policy. If the 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**, and make sure your IP address or DynDNS has been set up.

[![Screenshot&#95;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)

Configure the internal LAN interface and the DHCP service:

<div dir="auto" id="bkmrk-in-peplink-web-admin">

1. In Peplink Web Admin, navigate to **Network &gt; LAN** and select your client LAN or VLAN.
2. Locate **DNS Proxy Settings** and check the box to **Enable DNS Proxy**. Leave **Include Google Public DNS Servers** unchecked.
3. If Peplink manages DHCP for the network, locate **DHCP Server Settings** and set **DNS Servers &gt; Assign DNS server automatically**. This advertises the Peplink LAN IP address as the default DNS server to DHCP clients.
4. If an external device manages DHCP, set **DHCP Option 6** (DNS servers) on that server to the reachable Peplink LAN IP address.
5. Save and apply changes, then renew client network leases.

</div>With the LAN proxy active, configure the Peplink DoH engine to connect to your SafeDNS custom URL:

<div dir="auto" id="bkmrk-in-peplink-web-admin-1">

1. In Peplink Web Admin, navigate to **Network &gt; WAN &gt; DNS over HTTPS**.
2. Enable the **DNS over HTTPS** feature.
3. Set **Server** to **Custom URL**.
4. In the **URL** field, paste your copied SafeDNS token link `<span dir="auto">https://</span><span dir="auto">doh.safedns.com/</span>`
5. In the **IP Address** field, enter `195.46.39.41`.
6. Click **Save and Apply Changes**.

</div>##### **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.

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

[![Screenshot&#95;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)

<span dir="auto">Click **Copy Link** to retrieve your unique DoH URL. The default link format appears as `https://<token>.doh.safedns.com/`</span>

Configure the internal LAN interface and the DHCP service:

<div dir="auto" id="bkmrk-in-peplink-web-admin-2">

1. In Peplink Web Admin, navigate to **Network &gt; LAN** and select your client LAN or VLAN.
2. Locate **DNS Proxy Settings** and check the box to **Enable DNS Proxy**. Leave **Include Google Public DNS Servers** unchecked.
3. If Peplink manages DHCP for the network, locate **DHCP Server Settings** and set **DNS Servers &gt; Assign DNS server automatically**. This advertises the Peplink LAN IP address as the default DNS server to DHCP clients.
4. If an external device manages DHCP, set **DHCP Option 6** (DNS servers) on that server to the reachable Peplink LAN IP address.
5. Save and apply changes, then renew client network leases.

</div>With the LAN proxy active, configure the Peplink DoH engine to connect to your SafeDNS custom URL:

<div dir="auto" id="bkmrk-in-peplink-web-admin-3">

1. In Peplink Web Admin, navigate to **Network &gt; WAN &gt; DNS over HTTPS**.
2. Enable the **DNS over HTTPS** feature.
3. Set **Server** to **Custom URL**.
4. In the **URL** field, paste your copied SafeDNS token link `<span dir="auto">https://</span><span dir="auto">doh.safedns.com/</span>`
5. In the **IP Address** field, enter `195.46.39.41`.
6. Click **Save and Apply Changes**.

</div>---

#### **Bypass Prevention**

To prevent unmanaged clients or network users from bypassing SafeDNS filtering policies, enforce additional security rules within Peplink Web Admin and the SafeDNS Dashboard.

##### **Redirect Traditional DNS Requests**

Configure Peplink to intercept standard DNS queries sent directly to external resolvers (such as `8.8.8.8` or `1.1.1.1` on port 53):

<div dir="auto" id="bkmrk-open-advanced-%3E-misc">

1. Open **Advanced &gt; Misc. Settings &gt; Service Forwarding &gt; DNS Forwarding**.
2. Enable **Forward Outgoing DNS Requests to Local DNS Proxy**.
3. Save and apply changes. Standard UDP/TCP port 53 requests are automatically redirected to the local Peplink DNS proxy.

</div>##### **Block Outbound DNS-over-TLS (DoT)**

Prevent devices from establishing encrypted DNS-over-TLS sessions to third-party resolvers:

<div dir="auto" id="bkmrk-open-advanced-%3E-fire">

1. Open **Advanced &gt; Firewall &gt; Access Rules &gt; Outbound Firewall Rules**.
2. Add a new outbound rule positioned above general allow rules:

- **Rule Name / Action:** Block Outbound DoT / Deny
- **Protocol:** TCP
- **Destination Port:** `853`
- **Source Subnet:** Client Wi-Fi LAN / VLAN subnets
- **Destination:** Any external address

3. Save and apply rules to drop outbound TCP port 853 traffic.

</div>##### **Block Public Encrypted Resolvers in SafeDNS AppBlocker**

Restrict browser-based DoH fallback options inside the SafeDNS Dashboard:

<div dir="auto" id="bkmrk-in-safedns-dashboard">

1. In **SafeDNS Dashboard**, edit the filtering policy assigned to your Peplink device.
2. Under **AppBlocker &gt; VPN and Proxy**, block **Chrome/Firefox Secure DNS** and **Apple Private Relay**.
3. As appropriate, enable blocking for the **Proxies &amp; Anonymizers** category and add known public DoH bootstrap hostnames to the policy Denylist.
4. Save the policy settings.

</div>