Hi everyone. Trying to figure out who to ask and where to go for suggesting to edit the Wiki entry for setting up AdGuard Home on OpenWrt.
I accidentally discovered that following the setup instructions as per https://openwrt.org/docs/guide-user/services/dns/adguard-home from a fresh factory OpenWrt flash causes the local DNS loopback to fail, which in turn causes NTP, software upgrades and all connections from OpenWrt to fail.
As of now in the Wiki, they instruct us to only:
Set DNS server to listen on 192.168.1.1 at port 53.
What this means is by default, all IPv4 and IPv6 connections from the router fail. Clients are fine, but the device that OpenWrt is running alongside AdGuard Home fails.
Could I request for the Wiki to add a step right before the “Login AGH” section to copy and paste commands via ssh that will edit the /etc/adguardhome.yaml file to replace the dns bind_hosts with the loopback servers, and restart the adguardhome service?
Example (replace IPv6 with device’s actual one generated by OpenWrt):
If I didn’t accidentally discover my OpenWrt connections failing on the device and realised it was due to this issue, I would have been very lost. So the ability to add this to the Wiki guide may help others that will also experience this issue.
I'm not sure if setting 0.0.0.0 only would work, as I can see in the AGH Query Log that OpenWrt uses ::1 and 127.0.0.1 as localhost specifically to connect to downloads.openwrt.org successfully.
I also believe that during the initial configuration wizard, AGH only provides a drop down menu with a limited selection of interfaces. I can't recall what the selection was, but from what I've read it was better to only select 192.168.1.1, as the other option was to listen to all IPs, including wan:
If anyone has anything to add or clarify for my Wiki edit request, that would be appreciated. I'm not too experienced with this and just want to ensure others have a smooth setup experience with AGH and OpenWrt.
That's good to know, thanks for clarifying. Does that mean it will also cover when OpenWrt uses ::1 for IPv6 localhost as well?
If so, then it can mean we only need to either:
Provide instructions to edit the adguardhome.yaml file to change the bind_hosts entry to 0.0.0.0 only, where all DNS activity is directed (both DHCP clients and the OpenWrt router itself), with an optional step to set up Logs and Statistics to ignore *.arpa and *.lan domains in AGH; or
Provide instructions to edit the DNS server OpenWrt router uses via LuCI, as the other option you're suggesting, where we would need to keep in mind that there will be two seperate locations to monitor DNS success, one for OpenWrt/localhost and one for DHCP clients.
router trying ::1 is because it's been told to try both v4 and v6 localhost in resolv.conf.
would be interesting to see if 0.0.0.0 was an option in AGH though.
for 2nd option you could provide an upstream DNS, doesn't have to be on router.
I think that might be best, to add 0.0.0.0 and ::1 to the yaml. Is there any reason we aren't using 127.0.0.1 instead? Not too familiar in this area, so was just wondering.
Got it, it's only providing interface options, so the dropdown options are:
All interfaces
br-lan - 192.168.1.1
eth1 - (here would be your public IPv4 WAN address)
lo - 127.0.0.1
Interestingly, All interfaces includes the IPv6 ::1 and the router address as well, eg fa1a:c123:1234::1. The full address list added would be:
127.0.0.1
192.168.1.1 (IPv4 router address)
x.x.x.x (IPv4 WAN address)
::1
fxxx:x123:1234::1 (IPv6 router address)
Seeing the eth1 listed, this does explain why I kept reading in various sources not to leave it on All interfaces due to the IPv4 WAN address being included.
Other than eth1 IPv4 WAN address 'issue' though, leaving it on All interfaces would have meant everything would be working from the get go.
Perhaps it would be easier to instruct the user to leave it on All interfaces, then edit the yaml file to remove the IPv4 WAN address?
When I keep reading/watching others saying something along the lines of "we don't want our router exposed to the internet by opening port 53 up" by including the IPv4 WAN address in this list during AGH setup, it actually doesn't do so?
Thank you for helping me resolve this part of the Wiki, and for helping me understand a little better on how this all works. This should help others in future setups not have to go through a similar journey when OpenWrt suddenly stops connecting to things if following the Setup guide in the Wiki.