Newbie question: how to set DNS to work with Adguard on RPi4?

Recently our old router died and we got a loaner from a friend. It’s an older TP-Link Archer C2. I’ve been trying to set my custom DNS servers within openwrt, to use AdGuardHome.
AGH is running as an add-on within Home Assistant on a RaspberryPi 4. In our old router I had set our DNS to the ip-adressess AGH uses, but in OpenWRT I can’t seem to get it to work.

I’ve added the same IP’s in the custom DNS servers part of both the WAN and WAN6 interface (as described here: https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#upstream_dns_provider) but no luck so far.

Can anyone point me in the right direction? I’m at a complete loss...

Ive just been reading up on this. Use this guide to force specific DNS servers to all clients on the lan:

There are a few approaches to this...

If you want to simply advertise the Pi via DHCP to the client devices, you can set option 6 in the lan DHCP server settings.

Alternatively, you can keep the router as the DHCP advertised DNS and then set the router itself to use the Pi for DNS.

Client devices can override this, of course, so if you need to block alternate DNS servers, you can use the firewall to hijack and redirect the DNS to your Pi. This is useful if your users are going to try to outwit you and/or if the client devices have hardcoded/preferred DNS servers that you want to override; it is not always necessary, though... depends on your situation.

2 Likes

@fulltim3e41 Thanks so much! That was exactly what I needed!

@psherman

Alternatively, you can keep the router as the DHCP advertised DNS and then set the router itself to use the Pi for DNS.

I think I’ve done this initially, by cheer luck/ignorance, but not really what I wanted.

Thanks again!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.