MikroTik: DNS Servers Setup
source link: https://www.shellhacks.com/mikrotik-dns-servers-setup/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
MikroTik: DNS Servers Setup
Usually an Internet Service Provider (ISP) automatically provides its own Domain Name System (DNS) servers to its users.
However, in some cases it may be required to use a private or public DNS servers.
A MikroTik can be configured to use different DNS servers than those provided by your ISP by default.
This note shows how to setup the DNS servers on the MikroTik router from a command-line (terminal) or Winbox/Webfig.
Cool Tip: How to create a static DNS entry on a MikroTik router! Read more →
DNS Servers Setup on MikroTik
Uncheck the “Use Peer DNS” option under the “IP” → “DHCP Client” settings to disable ISP’s DNS servers:
To disable the “Use Peer DNS” option from the terminal, execute:
[admin@MikroTik] > /ip dhcp-client print - sample output - Columns: INTERFACE, USE-PEER-DNS, ADD-DEFAULT-ROUTE, STATUS, ADDRESS # INTERFACE USE-PEER-DNS ADD-DEFAULT-ROUTE STATUS ADDRESS ;;; defconf 0 ether1 yes yes bound 192.168.1.93/24 [admin@MikroTik] > /ip dhcp-client set ether1 use-peer-dns=no [admin@MikroTik] > /ip dhcp-client print - sample output - Columns: INTERFACE, USE-PEER-DNS, ADD-DEFAULT-ROUTE, STATUS, ADDRESS # INTERFACE USE-PEER-DNS ADD-DEFAULT-ROUTE STATUS ADDRESS ;;; defconf 0 ether1 no yes bound 192.168.1.93/24
Cool Tip: Free fast public DNS servers! Read more →
Open the MikroTik’s “DNS Setting” by going to “IP” → “DNS” and set the DNS servers:
To set the DNS server from the terminal, execute:
[admin@MikroTik] > /ip dns set servers=<dnsServerIP(s)> - example - [admin@MikroTik] > /ip dns set servers=8.8.8.8,8.8.4.4
Clear a DNS cache by clicking on the “Cache” button in the “DNS Settings” and then “Flush Cache”:
To clear the DNS cache from the terminal, execute:
[admin@MikroTik] > /ip dns cache flush
To enure that the DNS server settings of your MikroTik router have changed, open the DnsLeakTest.com from one of the connected devices and run a test:
In the example above I used the Google’s public DNS servers 8.8.8.8
and 8.8.4.4
, so instead of my IPS’s DNS servers the DnsLeakTest.com shows that I use the Google’s DNS servers.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK