--Here is my method--
1. Download Instructions:
In my version, I use the edge version. You are welcome to change it to match your setup. I run this on an RT-AX88U, so I chose linux_arm64 branch.
Using ssh terminal
Code:
cd /opt/etc
wget -c https://static.adguard.com/adguardhome/edge/AdGuardHome_linux_arm64.tar.gz
tar xfvz AdGuardHome_linux_arm64.tar.gz
rm -rf AdGuardHome_linux_arm64.tar.gz
cd AdGuardHome
2. First time run:
Here is where I run it for the first time to do the initial setup. This will allow us to generate our .yaml file. It will ask what listen addresses you want and what port. I chose 53 for DNS. I also set adguardhome gui port to 8081 -you can choose whatever port you want for the GUI, but DNS needs to run on 53 for this method to work.
Code:
killall -9 dnsmasq
nohup /opt/etc/AdGuardHome/AdGuardHome
The use of nohup allows it to run in the background.
minimize ssh terminal.
Initial setup is done from the browser at your routersaddress:3000
3.Place Adguard home in a path directory on entware installation:
Do this in the SSH terminal after initial setup.
Code:
killall -9 AdGuardHome
mv /opt/etc/AdGuardHome/AdGuardHome /opt/sbin/AdGuardHome
4. Make init.d file:
Code:
nano /opt/etc/init.d/S61AdGuardHome
Then paste this below script into the terminal.
Code:
#!/bin/sh
ENABLED=yes
WORK_DIR=/opt/etc/AdGuardHome
PROCS=AdGuardHome
ARGS="-c $WORK_DIR/AdGuardHome.yaml -w "$WORK_DIR" --no-check-update -l syslog"
PREARGS="nohup"
PRECMD="killall -9 dnsmasq"
POSTCMD="service restart_dnsmasq"
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export TZ=$(cat /etc/TZ)
. /opt/etc/init.d/rc.func
Save it and make it executable
Code:
chmod 755 /opt/etc/init.d/S61AdGuardHome
5. Make dnsmasq.postconf:
Code:
nano /jffs/scripts/dnsmasq.postconf
Then paste this below script into the terminal.
Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh
[ "$(pidof AdGuardHome)" ] && pc_append "port=553" $CONFIG && pc_append "local=/1.168.192.in-addr.arpa/" $CONFIG
Save it and make it executable
Code:
chmod 755 /jffs/scripts/dnsmasq.postconf
The addresses in the above script need to match your router address and network.
6. Start AdGuardHome:
Code:
/opt/etc/init.d/S61AdGuardHome start
7. Setup Private reverse dns servers for private addresses:
The addresses need to match your router address. And the domain needs to match the Domain you have defined on the lan dhcp page of your router.
Code:
[/1.168.192.in-addr.arpa/]192.168.1.1:553
[/Some-Domain/]192.168.1.1:553
View attachment 37465
You will need to check box enable-
User Private Reverse DNS Servers
Enable Reverse Resolving of clients IP addresses
8. Set upstream DNS servers:
You can set these to whatever you like. Adguard home supports plain text, DoT, DoH, QUIC, and Dnscrypt.
View attachment 37466
Here is the wiki on configuration
Network-wide ads & trackers blocking DNS server. Contribute to AdguardTeam/AdGuardHome development by creating an account on GitHub.
github.com
Edits
- Add support for dnsmasq at port 553 to run only when adguardhome is enabled, other wise use regular DNS.
- Added pictures
- Added Killall -9 dnsmasq to install instructions and to preargs of init.d script.