How to Set Up NextDNS on Your MikroTik Router to Encrypt DNS Requests

Introduction
Overview
The following is an overview of the steps outlined in this tutorial:
1) What is DNS over HTTPS (DoH) and What is the NextDNS service
2) Sign up for a user account on nextdns.io
3) Obtain the NextDNS root CA certificate
4) Specify static entries for the NextDNS DNS service.
5) Redirect all DNS Requests to the Mikrotik Router.
1. What is DNS over HTTPS and What is the NextDNS service
2. Sign up for a user account on nextdns.io
The first step to complete this setup is to sign up for a user account on the NextDNS website. Go to nextdns.io and click my.nextdns.io. Click then Sign Up link, enter an email address and password then click the Sign Up button. Open your mailbox and click the link from nextdns.io to confirm your account.

3. Obtain the NextDNS root CA certificate
These two commands will fetch the root CA certificate for NextDNS and import the certificate file into the router certificate store
4. Specify static entries for the NextDNS DNS service
The next step is to specify static entries for the NextDNS DNS service. The router also needs to be configured to redirect all DNS requests from client devices on the network to the NextDNS service. Run the command below to configure the IP addresses for the NextDNS DNS servers:
Enable the DoH functionality on the Mikrotik router. Click IP > DNS and click the Allow Remote Requests checkbox. Visit your NextDNS dashboard and copy your DNS-over-HTTPS URL. Return to the WinBox utility and paste your URL into the Use DoH Server field. The URL must include your NextDNS id, i.e https://dns.nextdns.io/your-unique-id
Ensure to remove any static DNS servers specified on the Servers field and Dynamic Servers field. Click Apply and click Ok.
5. Redirect all DNS Requests to the Mikrotik Router
Conclusion
You have successfully set up NextDNS on your MikroTik Router to Encrypt DNS Requests using DNS over HTTPS technology. We hope that this tutorial has been informative and would like to thank you for reading as well as learning from it