DNS Setting with AdGuard

Hello Community,

I am self-hosting AdGuard at home because I have an server available.
Now, I wanted to configure the DNS in Mikrotik and found it, that AdGuard only works if you no alternative DNS-Server configured.
For me, this wouldn’t be a problem, but my family is not IT versed and if the server is offline while I’m not at home, my family can’t access the internet.
Is there a way for Mikrotik to check if the DNS is working and only if not, to provide the alternative DNS-Servers?

Thanks,
Tropaion

Scripting.
You use your router as the resolver sent to clients, and you switch the server used by the routers resolver based on which one responds.
You can try searching the forum for different approaches, mostly by users using PiHole.
But this one I’ve used for some time: http://forum.mikrotik.com/t/dns-failover/127148/1
With an added

/ip dns cache flush

when switching to PiHole.

Thanks.
Is using the script better than using Netwatch?

As stated in the same topic, yes. Because netwatch only checks the ping reply, but the DNS service might be down and you end up with no working resolvers.

Another option could be to use The Dude to monitor the gadget and run the script if it’s down.

Ok, I set up the script now and it is working.
But since the DNS is change in the DNS-Section and not in the Network section, the router is also shown as an DNS-Server and the dns request to the router are passed on to AdGuard and AdGuard only sees the Router IP.
Is it possible to change the dns setting in network so that the request go directly to AdGuard or is there any other way?
Thanks for your help,
Tropaion

The easy one is to add dns on Ip>dhcp server>network> DNS server add your addguard ip there, i don’t use the netwatch script it kind of buggy sometimes
3.PNG
4.PNG
2.PNG
1.PNG
ad.PNG