Last active
September 26, 2020 08:59
-
-
Save AzimsTech/c20512b2b15763bc2677a9426266e281 to your computer and use it in GitHub Desktop.
Set AdGuard DNS Server ipv4 (Android)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/system/bin/sh | |
iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 94.140.14.14:53 | |
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 94.140.15.15:53 | |
iptables -t nat -I OUTPUT -p tcp --dport 53 -j DNAT --to-destination 94.140.14.14:53 | |
iptables -t nat -I OUTPUT -p udp --dport 53 -j DNAT --to-destination 94.140.15.15:53 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
@TITLE AdGuard DNS Setup | |
@COLOR 0E | |
@ECHO :: Setup AdGuard DNS iptables rules from adb. | |
@ECHO :: If you haven't already, please enable USB Debugging. | |
@ECHO. | |
@ECHO. | |
TIMEOUT 2 > NUL | |
@ECHO :: Pushing AdGuard-DNS-Server.sh to /sdcard | |
adb push %~dp0AdGuard-DNS-Server.sh /sdcard | |
TIMEOUT 3 > NUL | |
@ECHO. | |
@ECHO :: Moving the script to /data/adb/service.d and set its permission | |
adb shell "su -c 'mv /sdcard/AdGuard-DNS-Server.sh /data/adb/service.d & sleep 5 && chmod +x /data/adb/service.d/AdGuard-DNS-Server.sh'" | |
@ECHO. | |
@ECHO :: DONE. Reboot changes to take effect. | |
pause | |
adb kill-server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment