AdGuardDNS4Magisk sends your phone's DNS lookups to AdGuard DNS (94.140.14.14 and 94.140.15.15), which blocks ads and trackers at the DNS level. It's a fork of xerta555's CloudflareDNS4Magisk, and its module.prop credits Rom and TukangM.
What the scripts do
service.shaddsiptablesNAT rules that redirect outgoing port 53 traffic: TCP to94.140.14.14and UDP to94.140.15.15.post-fs-data.shusesresetpropto set DNS properties such asnet.dns1andnet.rmnet0.dns1.- If your ROM has
/system/etc/resolv.conf, it also writes the AdGuard servers to a systemless copy of that file.
Limits
- It only catches plain DNS on port 53. Encrypted DNS, such as Android's Private DNS or a browser's secure DNS setting, skips these rules.
- The redirect covers IPv4 only.
- The README warns that your network provider can block requests to custom DNS servers.
- All your DNS lookups go to AdGuard, so install it only if you trust them.
- The latest release is v2.7f from March 2023.
Install and remove
You need Magisk v17 or newer. Flash the zip in Magisk and restart. To undo it, remove the module and restart again, which also clears the iptables rules.