# Dns DoH and port 53

**URL:** <https://forum.mikrotik.com/t/dns-doh-and-port-53/264323>\
**Category:** General\
**Created:** [August 29, 2025, 1:22pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323 "2025-08-29T13:22:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 1:22pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/1 "2025-08-29T13:22:08Z")

</div>

Hello Mikrotik fellows.

i'm trying to figur out if my dns DoH connection is working properly.

When i torch my pppoe wan connection i can spot port 53 coming up on the SRC and some random port like 55553 on the DST.

Does this indicate there is something wrong with the config?

---

<div class="post-metadata">

**Author:** ![erlinden](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/erlinden/32/59042_2.png) [@erlinden](https://forum.mikrotik.com/u/erlinden)\
**Post date:** [August 29, 2025, 1:25pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/2 "2025-08-29T13:25:52Z")

</div>

DNS is using port 53  
DNS over TLS is using port 853  
DNS over HTTPS is using port 443

Please share /ip dns to check if the settings are correct. Once you specify a DoH server, it will be used. Only when the URL has to be resolved, a standard DNS query will be performed once.

---

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 1:38pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/3 "2025-08-29T13:38:28Z")

</div>

Hello erlinden,

thank you for your reply.

```routeros
/ip dns
set allow-remote-requests=yes servers=94.140.14.49,94.140.14.59 use-doh-server=https://d.adguard-dns.com/dns-query/ ********* verify-doh-cert=yes
/ip dns static
add address=192.168.88.1 comment=defconf disabled=yes name=router.lan type=A
add address=94.140.14.49 name=d.adguard-dns.com type=A
add address=94.140.14.59 name=d.adguard-dns.com type=A

```

So, if i understand you right, the use of the port 53 that i spotted on the torch is related to the resolver?

Is that also why, IP Service List shows up 2 entries with name resolver both on port 53, for tcp/udp ?

---

<div class="post-metadata">

**Author:** ![erlinden](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/erlinden/32/59042_2.png) [@erlinden](https://forum.mikrotik.com/u/erlinden)\
**Post date:** [August 29, 2025, 1:44pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/4 "2025-08-29T13:44:03Z")

</div>

I wouldn't expect a DNS request as you have static entries for this hostname.

Could it be that a client has a static DNS entry?  
Do you have default firewall (to exclude DNS requests from WAN)?

---

<div class="post-metadata">

**Author:** ![CGGXANNX](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/cggxannx/32/55490_2.png) [@CGGXANNX](https://forum.mikrotik.com/u/CGGXANNX)\
**Post date:** [August 29, 2025, 1:53pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/5 "2025-08-29T13:53:33Z")

</div>

> [@Pl0](#):
>
> i'm trying to figur out if my dns DoH connection is working properly.

You can temporarily point the DoH setting to Cloudflare `https://cloudflare-dns.com/dns-query`, then go to [https://one.one.one.one/help/](https://one.one.one.one/help/).

If it shows:

![image](https://data-discourse.cdn.mikrotik.com/original/3X/8/4/84b7d03fedfe9f8476b15a74267835a63679c045.png)

then your router is correctly configured to user DoH, and you just have to switch back to the URL from Adguard.

---

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 1:54pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/6 "2025-08-29T13:54:01Z")

</div>

I'm not aware of a client with a static dns entry, but i had the conception that if this would be the case, the router would replace this with the DoH.  
I also thought the resolving is also done on port 443.

```routeros

/ip firewall filter
add action=accept chain=input comment="defconf: accept established,related,untracked" connection-state=\
    established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept to local loopback (for CAPsMAN)" dst-address=\
    127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=\
    established,related disabled=yes hw-offload=yes
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=\
    established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
    connection-state=new in-interface-list=WAN
add action=drop chain=forward in-interface=Wifi1 out-interface=bridge
add action=drop chain=forward in-interface=Wifi2 out-interface=bridge
add action=drop chain=forward in-interface=Wifi3 out-interface=bridge
add action=drop chain=forward in-interface=Wifi4 out-interface=bridge
add action=drop chain=forward in-interface=Wifi5 out-interface=bridge
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=\
    WAN
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
/ip service
set ftp disabled=yes
set ssh disabled=yes
set telnet disabled=yes
set www disabled=yes
set winbox address=192.168.77.2/32
set api disabled=yes
set api-ssl disabled=yes

```

---

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 1:58pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/7 "2025-08-29T13:58:21Z")

</div>

Hi CGGXANNX,

thank you for your hint. I stumbled over the cloudflare check too, but didn´t thought about switching to Cloudflare settings to verify.

---

<div class="post-metadata">

**Author:** ![erlinden](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/erlinden/32/59042_2.png) [@erlinden](https://forum.mikrotik.com/u/erlinden)\
**Post date:** [August 29, 2025, 2:01pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/8 "2025-08-29T14:01:40Z")

</div>

Interception of DNS requests can be handled by the firewall, it would require a (actually 2) dst-nat rules. Both for UDP and TCP. But be aware that when the client uses DoT or DoH, nothing is intercepted.

```auto
add action=dst-nat chain=dstnat comment="Make Mikrotik preferred dns server UDP" dst-port=53 protocol=udp to-addresses=[IP of the router] to-ports=53
add action=dst-nat chain=dstnat comment="Make Mikrotik preferred dns server TCP" dst-port=53 protocol=tcp to-addresses=[IP of the router] to-ports=53

```

Can you share the output of:

`/ip dhcp-server network export`

Here is the DNS server set for the DHCP server to supply to the clients.

---

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 2:09pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/9 "2025-08-29T14:09:00Z")

</div>

> [@erlinden](#):
>
> `/ip dhcp-server network export`

```routeros
/ip dhcp-server network
add address=192.168.22.0/24 gateway=192.168.22.1
add address=192.168.33.0/24 gateway=192.168.33.1
add address=192.168.44.0/24 gateway=192.168.44.1
add address=192.168.66.0/24 gateway=192.168.66.1
add address=192.168.88.0/24 comment=defconf dns-server=192.168.88.1 gateway=192.168.88.1
add address=192.168.99.0/24 gateway=192.168.99.1

```

---

<div class="post-metadata">

**Author:** ![teslasystems](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/teslasystems/32/57003_2.png) [@teslasystems](https://forum.mikrotik.com/u/teslasystems)\
**Post date:** [August 29, 2025, 2:11pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/10 "2025-08-29T14:11:10Z")

</div>

If you want to understand what DNS requests are performed on your router, you can try using the packet sniffer to find that out.

---

<div class="post-metadata">

**Author:** ![erlinden](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/erlinden/32/59042_2.png) [@erlinden](https://forum.mikrotik.com/u/erlinden)\
**Post date:** [August 29, 2025, 2:12pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/11 "2025-08-29T14:12:11Z")

</div>

Okay...is it correct that only clients on the 192.168.88.0/24 network should do DNS requests? Perhaps you can give some more insights...as you seem to have 6 segments.

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [August 29, 2025, 2:14pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/12 "2025-08-29T14:14:02Z")

</div>

> [@Pl0](#):
>
> `192.168.88.1`

With that setup, on _88_ is provisioned 192.168.88.1 and in all the others dynamically the DNS of the RouterOS, if any (94.140.14.49 and 94.140.14.59),  
but the device is still free to use DoH, DoT, QUIC, & Co.

---

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 2:18pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/13 "2025-08-29T14:18:50Z")

</div>

Actually no. The setup of the 6 Wifi networks was done to seperate the devices from each other. I used client isolation but thought a seperate subnet wouldn´t hurt.

> Blockquote  
> With that setup, on _88_ is provisioned 192.168.88.1 and in all the others dynamically the DNS of the RouterOS, if any.

Whats the implication of this, is it a general problem that the encrypted traffic does not get intercepted?

> Blockquote

```auto
udp to-addresses=[IP of the router]

```

what Ip would that be in my case?

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [August 29, 2025, 2:24pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/14 "2025-08-29T14:24:41Z")

</div>

> [@Pl0](#):
>
> what Ip would that be in my case?

Honestly, of all the possible questions, I really didn't expect this one.............

---

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 2:26pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/15 "2025-08-29T14:26:37Z")

</div>

Hello rextended,

thank you for your reply.

At the moment, i want all devices to use only DoH.

Not sure, how to achieve this.

---

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 2:27pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/16 "2025-08-29T14:27:39Z")

</div>

Hello teslasystems,

thank you for your reply. I will try to use wireshark soon.

---

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 2:28pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/17 "2025-08-29T14:28:50Z")

</div>

😬 i'm sry.

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [August 29, 2025, 2:32pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/18 "2025-08-29T14:32:36Z")

</div>

What is the IP of your router?

192.168.88.1

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [August 29, 2025, 2:36pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/19 "2025-08-29T14:36:51Z")

</div>

> [@Pl0](#):
>
> At the moment, i want all devices to use only DoH.

Simply: You can't do the way you think.

You'll need to manually configure all the devices that allow it,  
but some will still want to use their hardcoded Chinese DNS, 8888/1111, etc.

At most, you can intercept calls to the cleartext DNS only, as much as possible, and redirect them to the router. The router then resolves them via DoH.

But all calls to non-standard DNS ports—DNScrypt, DNS over HTTPS, DNS over TLS, DNS over QUIK, etc.—will still pass.

At most, you can block DoT entirely on the standard port, or block all (know) DoH and DoQ via an address list, but you CANNOT redirect and resolve them.

---

<div class="post-metadata">

**Author:** ![Pl0](https://forum.mikrotik.com/letter_avatar/pl0/32/6_449c533f586939b6e5f246632a46421f.png) [@Pl0](https://forum.mikrotik.com/u/Pl0)\
**Post date:** [August 29, 2025, 2:37pm UTC](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323/20 "2025-08-29T14:37:25Z")

</div>

so ip of the router refers to the default gateway of the bridge ?

[Next page](https://forum.mikrotik.com/t/dns-doh-and-port-53/264323.md?page=2)
