AdGuard Addon configuration problems - can't resolve URLs

Hi all,
I hope I’m in the right place with this problem, and I’d really appreciate any help.
I’ve installed AdGuard as an Add-on to my Home Assistant, started it and added the integration to my dashboard. Then I put my Home Assistant’s IP into my router as the DNS server, and now I can’t resolve any URLs anymore, from any of the devices on my network.
If I click on the setup guide tab of the adguard settings it says

AdGuard Home DNS server is listening on the following addresses:

  • 127.0.0.1

I’ve tried adding my router as a persistent client in the client settings tab, but as far as i can tell that shouldn’t affect basic functionality? As you maybe can tell, I’m a little lost.

1 Like

Can you resolve IP’s directly against HA? For example, from a Windows machine:
nslookup google.com <HA IP>

From Linux:
dig @<HA IP> google.com

Thank you, that’s a really helpful troubleshooting step.
No, i cannot:

C:\Users\xxxx>nslookup google.com 192.168.178.48
DNS request timed out.
timeout was 2 seconds.
Server: UnKnown
Address: 192.168.178.48

DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
^C

So that means my Home Assistant isn’t currently funtioning as a DNS server, let alone filtering any ads, no?

That’s the problem. I don’t use the AdGuard addon but it must be using some means to resolve DNS lookups. 127.0.0.1 means that it’s going to HA’s host DNS settings. Is that the default? What if you point HA to 1.1.1.1?

I’m not quite sure what you mean by “point HA to 1.1.1.1” - I’ve already defined 1.1.1.1 as one of the upstream DNS servers in AdGuard’s DNS settings, in fact I think that was in the default configuration.
Can you elaborate?

Because you said above that AdGuard is listening on 127.0.0.1 I supposed that it was using HA’s internal DNS. But maybe it rather means that it’s not listening on the external machine IP, only on the loopback. If you do docker ps on the HA machine, does it show the AdGuard container with an external port mapping?

I’m not sure what “docker” is, the machine doesn’t recognize the command

[core-ssh ~]$ docker ps
bash: docker: command not found

If I just do ps I don’t get any mention of AdGuard, I’m afraid

[core-ssh ~]$ ps
PID USER TIME COMMAND
1 root 0:00 /package/admin/s6/command/s6-svscan -d4 – /run/service
15 root 0:00 s6-supervise s6-linux-init-shutdownd
17 root 0:00 /package/admin/s6-linux-init/command/s6-linux-init-shutdownd -c /run/s6/basedir -g 3000 -C -B
24 root 0:00 s6-supervise s6rc-fdholder
25 root 0:00 s6-supervise s6rc-oneshot-runner
33 root 0:00 /package/admin/s6/command/s6-ipcserverd -1 – /package/admin/s6/command/s6-ipcserver-access -v0 -E -l0 -i data/rules – /package/admin/s6/command/s6-sudod -t 30000 – /package/admin/s6-rc/command/s6-rc-oneshot-r
158 root 0:00 s6-supervise ttyd
160 root 0:00 s6-supervise sshd
161 root 0:00 ttyd -p 8099 tmux -u new -A -s homeassistant bash -l
162 root 0:00 sleep infinity
188 root 0:00 {tmux: client} tmux -u new -A -s homeassistant bash -l
192 root 0:01 {tmux: server} tmux -u new -A -s homeassistant bash -l
193 root 0:00 bash -l
233 root 0:00 ps

I’m about ready to tear my hear out, I’m sure I’m missing something really obvious, but it’s eluding me. I wish I could access the AdGuard configuration files via CLI, but I can’t find them.

Which way are you running HA? Addons run as separate docker containers and you interact directly with them using the docker command.

I’m running it as Home Assistant OS on a Raspberry Pi - so I’m kind of surprised that there’s not a docker command, since I’d assume that to be part of the default installation. Do I need to install it or something?

It should be available if you use the ssh addon.

I am using the ssh addon - and the output is as follows

[core-ssh ~]$ docker ps
bash: docker: command not found

I am having this exact same issue, and thanks to this thread I’ve been able to conclude that the docker container does not have an external port mapping.

That being said, similar to @rabbitambulance, I’m not quite sure how to address the issue. However, I find it weird because it does work some of the time, and not others. Perhaps this is related to caching, but it also sometimes works if I wait a little longer after getting the error.

Edit:
I reset my hardware and its working fine again at the moment, cleared my dns cache and did nslookup google <ip> and got an almost instant response. I checked the AdGuard logs and it did the query to https://dns.quad9.net:443/dns-query as expected, which only took 3ms. Right now it’s working great again, but within an hour or two it starts to have weird timeouts every time.

One notable difference is that mine is listening on quite a few more addresses,

  • Local Network IP Address
  • IPv6 Address
  • Docker Internal Network IP
  • The same loopback rabit mentioned, as well as ::1

When it’s happening see if you can resolve IP’s from inside the AdGuard container:

To see the containers:
docker ps

Then:
docker exec -it <container id> dig google.com

OCI runtime exec failed: exec failed: unable to start container process: exec: "dig": executable file not found in $PATH: unknown

Means that the container does not have the dig command. Most likely it’s resolving DNS using some other Linux utility.

That makes sense, though it does seem like it moves us back to square one haha

This command was able to ping the IP, but AdGuard is also working at the moment, so I’ll try again when it goes down again.
docker exec -it <container id> ping -c 4 google.com

Good idea. Yes, see what it says when it stops working next time.

I think I fixed it… I’ve had it working for about 5 hours now. The Address that was assigned to Home Assistant after I set it to static was ending in like 102 or something and my DHCP Address pool on my router was from 20 to 250. Even though Home Assistant was set to static, the router doesn’t know that and I think it was assigning out the IP Address again, which is why it would work for a while and then stop for seemingly no reason.
So I changed the Home Assistant static address to end in 15, rebooted the system, and it’s been working for 5 hours so far. I’ll update here if it starts failing again, but that may have been the issue.

But you had reserved that IP for HA in your router, right? Otherwise the router would assign it to something else. Although when that happens Windows computers sometimes detect that there’s a duplicate IP on the network and tell you.