DEV Community

Install AdGuard Home on Edgerouter X (including local hostname resoluion using dnsmasq)

Wesley Brewer on April 21, 2021

Introduction I used to run a pihole on my home network but recently moved to Adguard Home for simplicity. My pihole ran on a seperate R...
Collapse
 
geurtsd profile image
geurtsd • Edited

Wesley,

Great post.... To add some additional info: running this on Edge-X with multiple VLAN's and all working with ADGUARD....
Had some issues in configuring the listening mode to work on all IP's of the VLAN's.
by default the setup page of ADGUARD lets you choose to listen on a single interface OR all interfaces, yet no higher granularity....

So just to share for the rest how I got this to work for me:

  • Just follow you guide, upto and including the first manual run and config via port 3000
  • Exit the running ADGUARD
  • BEFORE you run the install: edit the AdGuardHome.yaml file and change the below section to your corresponding VLAN IP'S:
dns:
  bind_hosts:
  - 10.10.1.1
  - 10.10.10.1
  - 10.10.20.1
  - 192.168.200.1
Enter fullscreen mode Exit fullscreen mode
  • Save file
  • TEST with a manual run
  • Once verified --> continue with the INSTALL

just for reference, this only works for the DNS bind_Hosts... it does not work for the publication of the front-portal... here you can only have 1 entry (so still 0.0.0.0 if you want it available on ALL ports, !!!!!also your internet facing port!!!!!)

cheers,

Davy

Collapse
 
zer0ed profile image
Wesley Brewer

Thanks for the write up, I'm sure it will help others. I have yet to setup vlans on my network but this will be helpful for sure. Thanks for noting that listening on all interfaces (0.0.0.0) will include the internet facing interface. Very important and easy to overlook!

Collapse
 
anoob_just_4b96f68886295 profile image
a noob Just

Could you please help me to do manually update Adguard on edge router? There's no auto update on mine.

Collapse
 
zer0ed profile image
Wesley Brewer

This should work for manual update.
1) stop the service
2) download the new package
3) start the service.

sudo ./AdGuardHome -s stop
curl -sL https://static.adguard.com/adguardhome/release/AdGuardHome_linux_mipsle_softfloat.tar.gz | tar xvz
sudo ./AdGuardHome -s start
Enter fullscreen mode Exit fullscreen mode
Collapse
 
anoob_just_4b96f68886295 profile image
a noob Just • Edited

When I do sudo ./AdGuardHome -s start, there's an error:

 ./AdGuardHome: command not found
Enter fullscreen mode Exit fullscreen mode

What should I do next? Thanks

Thread Thread
 
zer0ed profile image
Wesley Brewer

are you in the AdGuardHome directory?

cd AdGuardHome
Enter fullscreen mode Exit fullscreen mode

also you can check your current path

pwd
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
anoob_just_4b96f68886295 profile image
a noob Just • Edited

When I do a start command, an error appear:

 ./AdGuardHome: cannot execute binary file
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
anoob_just_4b96f68886295 profile image
a noob Just • Edited
admin@ubnt:~/AdGuardHome$ ls -la
total 35232
drwxr-xr-x    3 admin    users         4096 Jun  6 22:31 .
 drwxr-xr-x    4 admin    users         4096 Jun 26 23:24 ..
-rwxr-xr-x    1 admin    users     35913728 Jun  6 22:31 AdGuardHome
-rw-r--r--    1 admin    users          331 Jun  6 22:31 AdGuardHome.sig
-rw-r--r--    1 admin    users        43421 Jun  6 22:31 CHANGELOG.md
-rw-r--r--    1 admin    users        35149 Jun  6 22:31 LICENSE.txt
-rw-r--r--    1 admin    users        23236 Jun  6 22:31 README.md
drwxr-xr-x    3 root     root          4096 Jun 23 06:29 data
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
gullyag profile image
Anthony Gossner

Having the same problem, did you ever resolve it?

Collapse
 
anoob_just_4b96f68886295 profile image
a noob Just

Thanks, I'll try it.

Collapse
 
zer0ed profile image
Wesley Brewer

Please note that I've had issues where my ERX device filled the root to 100% usage and as such I ran into issues on the device. I'm not sure what would happen if you reboot under these circumstances but I rather not tempt fate. If you do end up at 100% usage on / it's probably the fault of the Adguard logs. You can clear them on your Adguard web interface at Settings --> General Settings under log configuration. I also recommend you change some log retention settings to avoid this issue in the future!

I noticed the issues when I tried to change settings on my EdgeRouter web interface. I tried to enable some firewall rules I had in place and ended up with a red x icon instead of a green saved icon, ouch!

You can check for space issues on your Edgerouter at the command line with the "df" command. If your root / is at 100% you're going to have issues. Clear the logs and check again!

I've updated this guide to include the fix, under the heading "Reduce AdGuard logs". These steps include the remedy and prevention steps for this issue.

Sorry for the oversite lady and gents, lets keep those packets flowin'

Collapse
 
geurtsd profile image
geurtsd • Edited

Wesley,

small additional element to gain some room.....
most of the time the Edge-x has 2 system images on file (current and previous)

just run:

show system image

if there are multiple images you can:

delete system image

this will delete ONLY your previous system image (not your current)

it brought my df % down from 81% to 44%.

cheers,

Davy

Collapse
 
zer0ed profile image
Wesley Brewer

Nice, thank you for the heads up on this. I was not aware that it kept a firmware backup by default. Looking further into this, Ubiquiti documentation recommends doing it if you need more space.

It also mentions a similar command that shows the used space of each image.

show system image storage
Enter fullscreen mode Exit fullscreen mode

further reading: help.ui.com/hc/en-us/articles/2051...

Collapse
 
chyron8472 profile image
chyron8472

I'm at the step to run curl -sL https://static.adguard.com/adguardhome/release/AdGuardHome_linux_mipsle_softfloat.tar.gz | tar xvz but it responds with "tar: short read" and I can not continue further.

Collapse
 
aghsolvedproblem profile image
Scotty

Was having the same problem and updating the firmware fixed it.
Download: ui.com/download/software/er-x
Install: help.ui.com/hc/en-us/articles/2051...

Collapse
 
enricodeleo profile image
Enrico Deleo

This post addressed exactly what I was looking for. Thank you!

Collapse
 
zer0ed profile image
Wesley Brewer

You're welcome! I wrote it initially so I had a reference for myself to remember, then I thought why not share it. Also, check out my revision on the document as I ran into an issue with logging and space usage hitting 100%. It's an easy fix but better to fix it before you run into problems.

Collapse
 
enricodeleo profile image
Enrico Deleo

Update: no issues so far with storage after I changed to 24h retention! Profit!

Anyways I am facing issues trying to reach devices with .local domains (I used local instead of lan because I use home assistant that advertises as .local - and it works! - and I wanted to keep consistent). No luck trying to visit edgerouter.local even if edgerouter is the system name and I have

[/168.192.in-addr.arpa/]192.168.1.1:5353
[/local/lan/]192.168.1.1:5353

among upstream servers. I tried load-balancing and parallel resolution algorithms but cannot reach the router by name, only by IP :(

Any ideas?

Thread Thread
 
zer0ed profile image
Wesley Brewer • Edited
  • remove local from [/lan/]192.168.1.1:5353 just make it [/local/]192.168.1.1:5353
  • also there is now a new option to checkmark "enable reverse resolving of clients IP addresses". Keep that enabled.
  • maybe reboot the router after you changed the system name
  • do other clients resolve at [hostname].local ?
Thread Thread
 
enricodeleo profile image
Enrico Deleo • Edited

Tried everything. I think maybe because .local has a special meaning on macOS (avahi/bonjour discovery services) but still cannot figure out why it does work for home assistant and not for other hots (I guess it is because home assistant advertises this hostnames and other nodes not, but I'm not sure).

** update **

It's worthwhile mentioning that yes, .local domains do cause troubles on Apple OS (iOS, iPad, Mac). The solution I found is to enable an mdns repeater. Edgerouter luckily has avahi built-in so you just need to

configure
set service mdns reflector 
commit; save
Enter fullscreen mode Exit fullscreen mode

these commands will run dbus and avahi-daemon automatically and magically all hosts will be available under .local domain instead of 127.0.1.1 (which was the previous reply to all the ping commands I tried on my mac).

I dunno if there are any consequence/cons enabling this service (I have some security concern, I hope I didn't open any hole) but it works so far.

Collapse
 
kingtron profile image
kingtron • Edited

thanks for this useful and detailed guide, I have a problem in updating adguard, it does not update when there is a new version. I remember before we were be able to click "update" and get it updated, now you can only see the message "AdGuard Home v0.107.4 is now available! Click here for more info." and that is it. any idea ?
btw I'm using v0.107.3 thanks

dev-to-uploads.s3.amazonaws.com/up...

Collapse
 
sffetlio profile image
Svetoslav Popov

Thank you, works great. I'm using 0.106.2 and I still need
[/lan/]192.168.1.1:5353

Collapse
 
zer0ed profile image
Wesley Brewer

Good to know! Check out my revision on the document as I ran into an issue with logging and space usage hitting 100%. It's an easy fix but better to fix it before you run into problems.

Collapse
 
juka profile image
Duong Nguyen hoang

hi. Can you help me uninstall this from my Edgerouter X. I want to uninstall and install into Raspberry Pi 4

Collapse
 
zer0ed profile image
Wesley Brewer • Edited
cd AdGuardHome
sudo ./AdGuardHome -s uninstall
Enter fullscreen mode Exit fullscreen mode

should work, then you can remove the AdGuardHome folder if it's left over with

cd
rm -rf AdGuardHome
Enter fullscreen mode Exit fullscreen mode
Collapse
 
benek984 profile image
benek984

Hello,

Should I see hostnames instead of just IP addresses on the top clients list?

dev-to-uploads.s3.amazonaws.com/up...

Collapse
 
zer0ed profile image
Wesley Brewer

I find it works with some of my clients not all for some reason. Typically my phones and smart devices don't show their hostnames in AdGuard despite showing hostnames in the Edgerouter OS client list.

Collapse
 
johan_jansson_7134c394beb profile image
Johan Jansson

I messed up by not setting the AdGuard server to a static IP (didn't know how) and after a restart of the Edgerouter it's gone from 192.168.1.1. How to find it?