DNS Dynamic Servers

Hi everybody!

How do I reset the Dynamic-Servers list in RouterOS DNS settings, except for rebooting the router? Mine contains invalid entry 192.168.8.1, which cannot be removed by DHCP-client renew or release. Even temporarily disabling DHCP won’t help.

[admin@MikroTik] > /ip dns print
servers: 8.8.8.8,8.8.4.4
dynamic-servers: 192.168.8.1,85.21.192.5,213.234.192.7
allow-remote-requests: yes
max-udp-packet-size: 4096
query-server-timeout: 2s
query-total-timeout: 10s
max-concurrent-queries: 100
max-concurrent-tcp-sessions: 20
cache-size: 2048KiB
cache-max-ttl: 1w
cache-used: 51KiB
[admin@MikroTik] >

My config is hAP ac under RouterOS 6.40.6

Are you saying that you’ve had an error in the dhcp server which was thus providing this DNS address in the offers and acknowledgements, then you’ve fixed the error so the dhcp server does not push this DNS address any more, but it does not disappear after the dhcp client obtains a new lease? Or has the address appeared in the dynamic list “out of blue”?

The dynamic servers are set by the “Use peer DNS” option in the relevant interface or address setting option.
E.g. DHCP client or PPP client.
Just remove that checkmark and it will no longer set those dynamic servers.

This entry appeared after I temporarily plugged WAN interface to my other router with usb modem, because of the outage of my main inet provider.

Nice advise, I will try to turn off “Use peer DNS” and let you know the result.

In that case it sounds like a bug to me, as when the WAN interface went down, the lease should have got lost, and even if you have the physical WAN interface in a bridge, if the same client has obtained a new lease, albeit from a different server, the old one should have got lost as well.

Setting ****

use-peer-dns

to

no

doesn’t make the dhcp client forget the leases’ contents, so once you set it back to

yes

, the full list will be back. The lease is not renewed when you change the

use-peer-dns

setting back to

yes

.

In that case it sounds like a bug to me, as when the WAN interface went down, the lease should have got lost, and even if you have the physical WAN interface in a bridge, if the same client has obtained a new lease, albeit from a different server, the old one should have got lost as well.

Setting > ****

use-peer-dns

>
> to
>
> ```text
no

doesn’t make the dhcp client forget the leases’ contents, so once you set it back to

yes

>
> , the full list will be back. The lease is not renewed when you change the
>
> ```text
use-peer-dns

setting back to

yes

>
> .

Yes, you are right, disabling use-peer-dns doesn't help, now the dynamic-servers contains only one invalid entry:

```text
dynamic-servers: 192.168.8.1

Are you sure that this DNS address comes from the DHCP from the modem? Can’t it come from some VPN interface (L2TP, PPTP)? If not, then it’s really a big and only reboot can remove that address from the list.

Even more strange, after reenabling use-peer-dns I’ve got this:

dynamic-servers: 192.168.8.1,85.21.192.5,213.234.192.7,85.21.192.5,213.234.192.7

Obviously, this list is going totally messed.

Yes, this address is from USB-modem, no VPN here.

Rebooting the router has fixed the dynamic-servers list, now it contains only two entries (main and spare) received by DHCP from the ISP.

dynamic-servers: 85.21.192.5,213.234.192.7

Anyway IMHO this is “highly likely” a bug, which should be quite easy to reproduce, at least in RouterOS v6.40.6.