MikroTik (RouterOS)
RouterOS 7 has a DNS-over-HTTPS client in its resolver. The router sends every query it forwards to your profile over HTTPS, and devices on the network keep using the router as their DNS server.
You need: RouterOS 7, your profile id and a device name for the router
(such as mikrotik). The bootstrap entry below uses opdns’s
shared addresses.
-
Let the router check the resolver’s certificate. On RouterOS 7.19 and later, trust the built-in root store:
/certificate settings set builtin-trust-anchors=trustedOn older releases, import a CA bundle instead:
/tool fetch url=https://curl.se/ca/cacert.pem/certificate import file-name=cacert.pem passphrase="" -
Give the router a way to find the DoH host before DoH works, with a static entry for it:
/ip dns static add name=dns.opdns.net type=A address=23.166.164.53/ip dns static add name=dns.opdns.net type=AAAA address=2602:81f:6000::53Without it, RouterOS resolves the host through the servers in
/ip dns servers, in plain DNS. -
Point the resolver at your profile and drop the plain upstream servers:
/ip dns set use-doh-server="https://dns.opdns.net/<profile-id>/<device>" verify-doh-cert=yes servers=""/ip dns set allow-remote-requests=yesAlso turn off Use Peer DNS on the DHCP client of your WAN interface (
/ip dhcp-client set [find] use-peer-dns=no), or the provider’s servers come back as dynamic servers. -
Make sure LAN clients use the router: in IP → DHCP Server → Networks, set DNS Servers to the router’s LAN address, or leave it empty so the router hands itself out.
-
Flush the cache and check it works from a LAN device: its queries appear under the router’s device name.
/ip dns cache flush
Limits
Section titled “Limits”- One device name for the whole network. The router makes the queries, so every LAN device appears under the router’s name. For per-device names, configure encrypted DNS on each device as well.
- No fallback. With
servers="", a resolver outage stops name resolution on the network until you add a server back. - Hard-coded DNS. Devices that use their own DNS server or their own DoH bypass the router. A NAT rule that redirects outbound port 53 to the router catches the first kind; browsers with their own DoH need their own setting (Browsers).