How to delete all DNS Servers

Using the command line, I can add a DNS server using: ip dns set servers 8.8.8.8

Is there any way to remove all of the DNS servers (leaving only the Dynamic Servers) using the command line? The only command I have found allows me to replace the DNS servers with a new list of DNS servers, but it does not allow me to specify an empty list. The only way I have found to remove all DNS servers is using the GUI.

You can use

/ip dns edit servers

and remove everything inside it to remove all the entries. CTRL+O to save the changes.
If you want to add multiple entries from CLI, separate the addresses with a comma, example: 9.9.9.9,1.1.1.1

How about

/ip dns set servers=""

(note double quotes).

When you say dynamic DNS servers, do you simply mean you want all users to use the DNS servers from your ISP provider(s)?
If not which DNS servers are you referring to??

Thanks to all who replied. As noted, mkx’s solution solved the problem.

To anav, yes, what I want to do is use only the servers from my ISP provider. In the GUI, these are displayed as Dynamic Servers.

To reiniss2, this solution would probably work, but is not as elegant as using double quotes.

Okay that would have been dirt simple using WINBOX.
If you want to force all users to use the ISPs dns servers…

  1. Ensure under dhcp client that the checkbox “USE PEER DNS” was checked off was used.

  2. Under IP DNS - Remove any manually inserted DNS servers such as 8.8.8.8 or Open DNS ones etc.

  3. Also while there click on the Static Tab on the right because the default setup sneakily puts one in there and it took me forever to find the pesky bugger.

  4. Ensure each network
    /ip dhcp-server network has the gatewayIP of the network selected for DNS associated IP

  5. In your firewall NAT rules put in the following redirect rules (you will note they are disabled at the moment and mine are setup to apply to my non vlan interfaces and thus you will have to substitute for your own applicable LAN interfaces - could be in-interface-list=lan for example)…

add action=redirect chain=dstnat comment=
“Force Users to Router for DNS - TCP” disabled=yes dst-port=53 protocol=
tcp src-address-list=!VLAN_Interfaces
add action=redirect chain=dstnat comment=
“Force Users to Router for DNS - UDP” disabled=yes dst-port=53 protocol=
udp src-address-list=!VLAN_Interfaces

  1. I am curious to get feedback from others about the value of placing the following two forward chain rules, BEFORE the first standard accept established and related rules
    add action=drop chain=forward comment=“Drop LAN DNS queries-UDP” dst-port=53
    in-interface-list=WAN protocol=udp
    add action=drop chain=forward comment=“Drop LAN DNS queries - TCP” dst-port=
    53 in-interface-list=WAN protocol=tcp

Especially because my last forward chain rule is DROP all else anyway.