I had the same problem with my opal, however wanted to be able to disable adguardhome for captive portals and easiest to have it on the gl.inet front end (so didn’t want to change default dns port etc), so i put the routing change into the service start stop action…
good point about the local dnsmasq hostname lookup, hadn’t considered that!
i also built a custom firmware with all my settings built into it which comes in handy if i’m messing with my router on holidays and break something… means i can just reset it back to the known working state… very handy!
/etc/init.d/AdGuardHome
start_service()
{
…
iptables -t nat -A PREROUTING -p tcp --dport 53 -j DNAT --to ROUTER_IP:3053
iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to ROUTER_IP:3053
}
stop_service()
{
…
iptables -t nat -D PREROUTING -p tcp --dport 53 -j DNAT --to ROUTER_IP:3053
iptables -t nat -D PREROUTING -p udp --dport 53 -j DNAT --to ROUTER_IP:3053
}
2 Likes