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
- IP > DNS: enter the servers, tick Allow Remote Requests.
- IP > DHCP Server > Networks: set DNS Servers to the router IP or FirewallDNS.
- IP > DHCP Client: untick "Use Peer DNS" on WAN.
- 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=53Verify it works
- Renew DHCP on a client (Windows:
ipconfig /renew, macOS: reconnect Wi-Fi). - Run
nslookup example.comand check which server answered. - Open the live log in your dashboard. New lookups should appear within seconds.