Ad-block on OpenWrt AP?

I have a Pi-hole LXC and Adguard LXC running on a Proxmox host. I want to use both for ad-blocking on clients connected via an OpenWrt AP.

I did read pi-hole guide from this link but I think I did something wrong.

Then do it.

Option 6 in https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#dhcp_options

how to do this from OpenWrt GUI?

Copied from a thread created 4hrs ago.

1 Like


Is this correct now?

Looks good.


This Use custom DNS servers should be left blank?

The setting has nothing to do with your clients.

Just to clarify, this just offers the choice of Pi-hole LXC or Adguard LXC as DHCP options for clients. This setting would not mean clients would use both, correct?


it doesn't seems to be working.

It basic fail over, one of them will be queried, usually the 1st one.
If there's no reply, the 2nd one will be queried too.

1 Like

It won't, until you do a DHCP request for an IP renewal.

You have 820 queries, what's not working?

those 820 queries are from when I had manually set DNS on a windows machine.

Please restart the odhcpd in openwrt and manually give command in windows ipconfig /renew, after that check with ipconfig /all if the mahcine uses the new dns servers.

1 Like

restarted openwrt AP, did ipconfig /renew and this relevant output of ipconfig /all

Windows IP Configuration

Windows IP Configuration

   Host Name . . . . . . . . . . . . : xxxxxxx
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

and

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Killer(R) Wi-Fi 6 AX1650x 160MHz Wireless Network Adapter (200NGW)
   Physical Address. . . . . . . . . : xxxxxx
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv4 Address. . . . . . . . . . . : 192.168.18.xxx(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Monday, 17 March 2025 10:14:35 PM
   Lease Expires . . . . . . . . . . : Monday, 24 March 2025 10:15:00 PM
   Default Gateway . . . . . . . . . : 192.168.18.1
   DHCP Server . . . . . . . . . . . : 192.168.18.1
   DNS Servers . . . . . . . . . . . : 192.168.18.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Keep in mind at least Win11 have secure dns settings, they will probably make the OS bypass your DNS.

The settings in ipconfig should still show the IPs you want.

Is this the openwrt router where the odhcp is running ? Sometimes the virtual environments cause delays in this kind of configuration changes.

1 Like

DHCP server is ISP's router 192.168.18.1
Pi-hole is at 192.168.18.94
Ad-guard is at 192.168.18.80

this is Win11.

you can easily tcpdump the traffic to see if dnsmasq is announcing the IPs you've configured.

I also assume you haven't hard coded the DNS IP in windows...