Network Equipment

    How to Change DNS on MikroTik RouterOS

    By [FILL IN], [FILL IN] · Last updated

    Set MikroTik DNS and the DHCP network.

    Before you start

    You need a FirewallDNS account (see pricing). Sign in to your dashboard, register your public IP address and copy your DNS server addresses. Replace <FIREWALLDNS-PRIMARY> and <FIREWALLDNS-SECONDARY> below with them.

    Step by step

    1. IP > DNS: enter the servers, tick Allow Remote Requests.
    2. IP > DHCP Server > Networks: set DNS Servers to the router IP or FirewallDNS.
    3. IP > DHCP Client: untick "Use Peer DNS" on WAN.
    4. Firewall NAT: redirect LAN port 53 to the router.

    RouterOS CLI

    /ip dns set servers=<FIREWALLDNS-PRIMARY>,<FIREWALLDNS-SECONDARY> allow-remote-requests=yes
    /ip dhcp-client set [find] use-peer-dns=no
    /ip dhcp-server network set [find] dns-server=192.168.88.1
    /ip firewall nat add chain=dstnat in-interface-list=LAN protocol=udp dst-port=53 action=redirect to-ports=53
    /ip firewall nat add chain=dstnat in-interface-list=LAN protocol=tcp dst-port=53 action=redirect to-ports=53

    Verify it works

    1. Renew DHCP on a client (Windows: ipconfig /renew, macOS: reconnect Wi-Fi).
    2. Run nslookup example.com and check which server answered.
    3. Open the live log in your dashboard. New lookups should appear within seconds.

    Learn more

    Not protected yet?

    FirewallDNS costs $2.90 per device per month.