I use the script which automatically changes DNS if Pi-hole is no longer working"
Code: Select all
:local currentDNS [/ip dns get server]
:local piholeDNS "192.168.3.12"
:local backupDNS "1.1.1.1,1.1.1.2"
:local testDomain "www.google.com"
:if ($currentDNS = $piholeDNS) do={
:do {
:resolve $testDomain server $piholeDNS
} on-error={
/ip dns set servers=$backupDNS
/ip dhcp-server network set [find] dns-server=$backupDNS;
}
} else={
:do {
:resolve $testDomain server $piholeDNS
/ip dns set servers=$piholeDNS
/ip dhcp-server network set [find] dns-server=$piholeDNS;
} on-error={}
}
viewtopic.php?t=161785
It works flawlessly, but I'd like it not to change also DNS IPs in " /ip dns>" which should always be set as 1.1.1.1 and 1.1.1.2.
I need that only the DNS server in
Code: Select all
/ip dhcp-server network
Could you help me change it..if possible?
Thanks