Community discussions

MikroTik App
 
Tropaion
just joined
Topic Author
Posts: 13
Joined: Fri Oct 18, 2019 6:48 pm

DNS Setting with AdGuard

Sun Mar 14, 2021 11:30 pm

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
 
User avatar
Znevna
Forum Guru
Forum Guru
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

Re: DNS Setting with AdGuard

Sun Mar 14, 2021 11:41 pm

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: viewtopic.php?t=144577#p757274
With an added
/ip dns cache flush
when switching to PiHole.
 
Tropaion
just joined
Topic Author
Posts: 13
Joined: Fri Oct 18, 2019 6:48 pm

Re: DNS Setting with AdGuard

Mon Mar 15, 2021 3:41 pm

Thanks.
Is using the script better than using Netwatch?
 
User avatar
Znevna
Forum Guru
Forum Guru
Posts: 1347
Joined: Mon Sep 23, 2019 1:04 pm

Re: DNS Setting with AdGuard

Mon Mar 15, 2021 3:59 pm

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.
 
Cablenut9
Long time Member
Long time Member
Posts: 542
Joined: Fri Jan 08, 2021 5:30 am

Re: DNS Setting with AdGuard

Mon Mar 15, 2021 4:08 pm

Another option could be to use The Dude to monitor the gadget and run the script if it's down.
 
Tropaion
just joined
Topic Author
Posts: 13
Joined: Fri Oct 18, 2019 6:48 pm

Re: DNS Setting with AdGuard

Mon Mar 15, 2021 5:35 pm

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
 
User avatar
dioeyandika
just joined
Posts: 19
Joined: Fri Feb 08, 2019 11:30 am

Re: DNS Setting with AdGuard

Tue Jun 15, 2021 3:08 pm

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
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: anav, Andrey05 and 99 guests