OpenWrt AdGuard Home 101 ( DNSMASQ )

Let me grab my script. I did similar to you in that i disabled ISP DNS upstream then moved DNSMasq.

However the gotcha is the exact steps. You have to pull and install AGH, then move DNSMasq, then configure AGH (and thus take over DNS). And then u have to tweak the listen addresses via the yaml file.

#!/bin/sh
# Switch to Adguard setup
# Grab packages for AGH and updates.
opkg update
opkg install sudo ca-certificates ca-bundle curl wget tar unzip libustream-mbedtls libustream-openssl libwolfssl libustream-wolfssl

#grab and install AGH
curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -c edge

#now move DNSMasq
uci set dhcp.@dnsmasq[0].cachesize='1000'
uci set dhcp.@dnsmasq[0].noresolv='1'
uci set dhcp.@dnsmasq[0].server='192.168.1.1'
uci set dhcp.@dnsmasq[0].port='5353'
uci add_list dhcp.lan.dhcp_option='6,192.168.1.1' # DHCP option 6: which DNS (Domain Name Server) to include in the IP configuration for name resolution
uci add_list dhcp.lan.dhcp_option='3,192.168.1.1' #DHCP option 3: default router or last resort gateway for this interface
uci set dhcp.lan.leasetime='24h' #24hr DHCP Leases
uci set network.wan.peerdns='0' #Do Not use ISP DNS
uci set network.wan.dns='1.1.1.1' '1.0.0.1' #set WAN dns to Cloudflare


uci commit dhcp
uci commit network
# Save changes

# Restart network + dnsmasq service to reflect changes
/etc/init.d/network restart
/etc/init.d/dnsmasq restart

echo 'Goto http://192.168.1.1:3000 and configure AdGuardHome.'

Missing from my script is ipv6 as my ISP still doesn't support it so you need to potentially edit those entries if your ISP properly supports it.