this has been asked before, but i cannot find the specific answer, just pieces here and there, i have made it work based on piecing things together but I want to verify my knowledge and maybe clarify it a bit
the steps i performed are:
install default openwrt on flint2
install default adguardhome on rpi4 default port 53
go to dhcp and dns→ ports, change dns port in luci to 54,
go to dhcp and dns→ forwards, add 192.168.1.125(adguardhome ip)
go to lan→ dhcp→ advanced → add 6,192.168.1.125(adguardhome ip)
disable wan dns peers
is this the current correct method? am i doing anything extra that i dont need to? am i missing anything?
Your superfluous description is not sufficient to assesss agh workings.
1/ what are upstreams of agh
2/ and of dnsmasq
3/ any firewall rules related to dns
i originally tried setting the wan dns to agh per one suggestion. this gave me only a single client in agh, being the flint2
i then tried another suggestion of setting the dns in the lan settings, which gave the same result
i found an article stating to use the 6,ip option and thats when i started to get things working, but alot of other suggestions were made with it, such as setting the dns forwards under dhcp and dns, that is why i ended up as confused as i am,
assuming the only dns set in openwrt is the resolv file with default isp dns, if i go and change the lan→dhcp→advanced 6,192.168.1.125, and dhcp and dns→resolve and hosts files ignore resolv file everything connected to my local network should then use agh for dns by default?
For the best performance and lowest latency on DNS requests, AGH should be your primary DNS resolver in your DNS chain. If you currently have dnsmasq or unbound installed, you should move these services to an alternative port and have AGH use DNS port 53 with upstream DNS resolvers of your choice configured. This wiki recommends keeping dnsmasq/unbound as your local/PTR resolver for Reverse DNS.
this is why i was referencing changing the dns port on the openwrt device to 54
that helps, the overabundance of setups and guides can make it hard to decide whats what sometimes, i really tried to dig this one up before posting and i ended up with so much info my head is spinning lol.
i thought it was working but i noticed the guest network could no longer resolve even using the same settings.
im back to stock now, i reinstalled openwrt fresh on my flint2, and reinstalled adguardhome on the pi
no guest network configured,
no changes to anything except the 6,ip and it seems that devices are starting to show up correctly.
but if i run dns leaktest im still seeing my default isp provided. i dont want to disable the resolv file because that seems to break things
if i use
# Intercept DNS traffic
uci -q del firewall.dns_int
uci set firewall.dns_int="redirect"
uci set firewall.dns_int.name="Intercept-DNS"
uci set firewall.dns_int.family="any"
uci set firewall.dns_int.proto="tcp udp"
uci set firewall.dns_int.src="lan"
uci set firewall.dns_int.src_dport="53"
uci set firewall.dns_int.dest_port="53"
uci set firewall.dns_int.target="DNAT"
uci commit firewall
service firewall restart
will the 6,ip setting still take the hijacked requests, or will the routers dnsmasq process them?
i understand your frustration with me, im frusterated too, i appreciate the assistance i will try to figure out a better way to pose my question. i have a habbit of just talking out my problems.
the above configs are all current, without a firewall rule devices that grab a new lease work as requested, i am just trying to determine which firewall rule/port forward option would be the best to ensure any devices that try to force their own dns are captured and processed through agh instead,
dns hijacking seems logical but infers that its catching it to the router itself, which im not certain would redirect it to the rpi4 agh instance
i think this is the correct option, based on the bottom of the dns hijacking page, dns redirect via the firewall, i adjusted the values from the official documentation to match what i think is the correct option, im hesitant to test this yet because i dont know how to recreate it via the gui, and while im not afraid to use uci commands, i dont know how to revert them if im wrong without just starting over entirely
# Configure firewall
uci set firewall.dns_int.name="Redirect-DNS"
uci set firewall.dns_int.family='ipv4'
uci set firewall.dns_int.dest_ip="10.164.20.125"
uci set firewall.dns_int.src_ip='!10.164.20.125'
uci commit firewall
service firewall restart
# Configure network
uci add_list network.lan.ipaddr="10.164.20.1/24"
uci commit network
service network restart
agh (10.164.20.125) available as dns server to whole home - dhcp option 6 accomplishes this, with sneaky devices being the exception.
firewall rules/port forwards to disallow devices trying to be sneaky by redirecting them back to agh
the agh device can see the hostnames of clients instead of only the router ip (rdns accomplishes this)
the openwrt router (10.164.20.1) can still get updates and time - i cant figure this out yet
the dns hijacking page/dns redirecting page, seems to assume agh is installed on the router.
the problem i run into, is, when i set the port forward with source ip !10.164.20.125 per the redirect rule, agh and clients works normally, but opkg update fails because it has no dns once the hijacking rule goes into place.
i was hoping i could set a rule that said, if this router needs dns use wan dns, if any other device needs dns use agh. but i do not know how to write this in uci terms and there does not appear to be a way with the UI.
i THINK i could set somthing in upstream resolvers in agh for requests coming from the router itself, but the documentation on that is not super clear