• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[APP][5.0+] DNS66 - Open Source Host/Ad-Blocker without Root

Search This thread
Jul 29, 2011
20
7
I don't see how you could block everything, except something.
You should write zillion entries to be blocked

For that a firewall is better - block the whole Internet and only provide a route to something.
If you could do it on the WLAN side, even easier, safer and better

Or force to use a specific DNS server (with eg VPN to a private DNS) that will not resolve anything (better will block by resolving to 0.0.0.0), except your site.
Or even dummy DNS and give them directly IP address to your site.

Thanks very much indeed! Some great ideas thanks. Sorry for the delay - Ethiopia's internet was blocked for a few weeks. I haven't had much luck finding a firewall as simple to set up as DNS66 (in fact I've been intending to add a third "block" state to the APP tab "bypass" switch for some years, so you could block some apps completely and DNS66-filter the rest), and my app is browser-based. My users are all over Ethiopia so I can't use WLAN rules. Would the DNS server idea mean me running a DNS server then setting that up in the DNS tab? That sounds harder than rebuilding DNS66.

For now, I have hardcoded my URLs in `org.jak_linux.dns66.db.RuleDatabase` and from some very shallow initial tests it seems to be working, now just need to remove hosts parsing, system apps bypass, initial "missing hosts file" confirmation, and the HOSTS, APPS and DNS tabs, and figure out how to change the app name properties. Was amazed how easy it was to build, although can't seem to get the release version to install, only debug - maybe something to do with signing. I might then add a password to the Stop button so that parents can give children their phones confident that they can't do anything other than their school work (with an 8 hour timeout for the forgetful). Love open source..enormous thanks Julian Klode.
 
Last edited:

64ashg

Senior Member
May 18, 2014
548
351
Redmi K20 Pro
Hello, recently there is no way to change dns in Chrome flags so the ads are back on chrome and I don't find any way to blocked them
If you are using android 9 or above, you can set your private dns in settings> network and internet> advanced to dns.adguard.com

If you are using a skinned tom like miui 11 or something, you might hqve to jump a few hoops to unlock tgis setting, many ways using apps, google it and you'll find it.
 

zgfg

Senior Member
Oct 10, 2016
5,484
2,815
Hello, recently there is no way to change dns in Chrome flags so the ads are back on chrome and I don't find any way to blocked them
I cannot find (to disable it) Async DNS resolver, either.
You can try by disabling Lite mode (former Data Saver) in Settings (no need for hidden URLs to reach) - please confirm does it work or not (working for me but for AdAway with root)
 

Incomtus

Senior Member
Apr 30, 2016
230
42
soundcloud.com
I cannot find (to disable it) Async DNS resolver, either.
You can try by disabling Lite mode (former Data Saver) in Settings (no need for hidden URLs to reach) - please confirm does it work or not (working for me but for AdAway with root)
Thanks. I tried but it doesn't work either

---------- Post added at 08:59 AM ---------- Previous post was at 08:58 AM ----------

Try after some time, maybe their dns server near you is down for now.
If it still doesn't work, your browser or your isp is blocking it..
I will see about it. If it doesn't work I ll use another browser. Maybe I can find dns resolver in Chrome beta or something like that

---------- Post added at 09:05 AM ---------- Previous post was at 08:59 AM ----------

Try after some time, maybe their dns server near you is down for now.
If it still doesn't work, your browser or your isp is blocking it..
I think you are right the browser block it because there is still connection for other apps. Only the browser blocks ???
 

64ashg

Senior Member
May 18, 2014
548
351
Redmi K20 Pro
Thanks. I tried but it doesn't work either

---------- Post added at 08:59 AM ---------- Previous post was at 08:58 AM ----------


I will see about it. If it doesn't work I ll use another browser. Maybe I can find dns resolver in Chrome beta or something like that

---------- Post added at 09:05 AM ---------- Previous post was at 08:59 AM ----------


I think you are right the browser block it because there is still connection for other apps. Only the browser blocks ???
Stop using chrome then, bromite or firefox or the lineage os jelly browser..
 

rootawayasus

Member
Nov 11, 2017
34
0
I have a big problemi with DNS66. It doesn’t work at all.

I want to use it for the dns changer. I’ve put my custom DNS and enabled it but it has no effect.
What i have to do? Any incompatibility?

My smartphone is a LG Q7 with Android 9.
 
I have a big problemi with DNS66. It doesn’t work at all.

I want to use it for the dns changer. I’ve put my custom DNS and enabled it but it has no effect.
What i have to do? Any incompatibility?

My smartphone is a LG Q7 with Android 9.
If this problem occurs on mobile data there is probably a proxy defined in your APN settings. So your phone does not use DNS at all.
If the problem occurs in your web browser you should disable any "data compression" or "web optimizing" or settings like that. All request will be handled by an external server in this case, so your local dns table will be ignored.
 

rootawayasus

Member
Nov 11, 2017
34
0
If this problem occurs on mobile data there is probably a proxy defined in your APN settings. So your phone does not use DNS at all.
If the problem occurs in your web browser you should disable any "data compression" or "web optimizing" or settings like that. All request will be handled by an external server in this case, so your local dns table will be ignored.

With other apps i can change DNS without no problem, for example these ones:

https://play.google.com/store/apps/details?id=dns.hosts.server.change&hl=it
https://play.google.com/store/apps/details?id=com.frostnerd.dnschanger&hl=it

Anyway, i use Chrome as browser and i've checked right now, i have no proxy APN.

Really i don't understand why DNS66 doesn't work. Also with another app:

https://forum.xda-developers.com/android/apps-games/app-personaldnsfilter-block-malware-t3567898

i have the same problem, i can't change the DNS.
 

jwarrior319

Senior Member
With other apps i can change DNS without no problem, for example these ones:

https://play.google.com/store/apps/details?id=dns.hosts.server.change&hl=it
https://play.google.com/store/apps/details?id=com.frostnerd.dnschanger&hl=it

Anyway, i use Chrome as browser and i've checked right now, i have no proxy APN.

Really i don't understand why DNS66 doesn't work. Also with another app:

https://forum.xda-developers.com/android/apps-games/app-personaldnsfilter-block-malware-t3567898

i have the same problem, i can't change the DNS.
Thats just a limitation of chrome. They pushed an update that forces async dns. In my situation its still working possibly due to the setting being stored in cache or something but im not gonna test that theroy. If ads are still blocked in firefox or other browsers then theres nothing that can be done.

Edit: the only workaround is wifi with a hosts file setup on the router.

Sent from my LM-V600 using XDA Labs
 

rootawayasus

Member
Nov 11, 2017
34
0
Thats just a limitation of chrome. They pushed an update that forces async dns. In my situation its still working possibly due to the setting being stored in cache or something but im not gonna test that theroy. If ads are still blocked in firefox or other browsers then theres nothing that can be done.

Edit: the only workaround is wifi with a hosts file setup on the router.

Sent from my LM-V600 using XDA Labs

You're great! DNS66 works finally! Just changed the browser, now i have firefox and it works.

But i have a GREAT question: Why, if i use another app, like NetGuard, it works with Chrome too?

Is this a limit of DNS66?

---------- Post added at 00:11 ---------- Previous post was at 00:06 ----------

DNS66 works on both Wi-Fi and Mobile Data?
 

rootawayasus

Member
Nov 11, 2017
34
0
Guys, i need your intelligence.

How do i set the automatic restart of the vpn when i do the phone reboot even if the app has been stopped?

Example: I stop DNS66 - Reboot the phone - VPN is OFF

I want: I stop DNS66 - Reboot the phone - the vpn is automatically enabled at every start.

Any idea?
 

zgfg

Senior Member
Oct 10, 2016
5,484
2,815
Guys, i need your intelligence.

How do i set the automatic restart of the vpn when i do the phone reboot even if the app has been stopped?

Example: I stop DNS66 - Reboot the phone - VPN is OFF

I want: I stop DNS66 - Reboot the phone - the vpn is automatically enabled at every start.

Any idea?
Open your phone Settings and search for Autostart , and add DNS66 into the list

You should probably also add it under Battery optimization, disable Optimization for DMS66 to prevent closing the app while phone goes to deep sleep

Things depend on your phone, some vendors force their own 'optimizations' and may not give an easy way to users to manage apps to be autostarted and to stay on
 

rootawayasus

Member
Nov 11, 2017
34
0
Open your phone Settings and search for Autostart , and add DNS66 into the list

You should probably also add it under Battery optimization, disable Optimization for DMS66 to prevent closing the app while phone goes to deep sleep

Things depend on your phone, some vendors force their own 'optimizations' and may not give an easy way to users to manage apps to be autostarted and to stay on

Already done. The autostar works for the app, not for the vpn. The app is launched, but the vpn is disabled, for this reason most apps have the "Auto Re-Connect" option, DNS doesn't have it, so i need fo find a solution for this.
 

jwarrior319

Senior Member
Already done. The autostar works for the app, not for the vpn. The app is launched, but the vpn is disabled, for this reason most apps have the "Auto Re-Connect" option, DNS doesn't have it, so i need fo find a solution for this.
Works fine for me. Probably a phone manufacturer thing then.

Sent from my LM-V600 using XDA Labs
 

Top Liked Posts

  • There are no posts matching your filters.
  • 195
    Hey,

    I am the developer of DNS66, a free (GPL-3) host and ad blocker for Android 5.0 and newer. It utilises Android's VPN service to redirect DNS traffic to the local app, and filters out any blocked hosts from reaching the servers (instead responding directly with "non-existing domain").

    As it only intercepts DNS traffic it is a fairly lightweight solution and does not seem to have any measurable effect on the battery life. Given that it only blocks entire host names, it cannot block as detailed as some other ad blockers. But it still catches almost all ads on the web.

    The project can be found in the https://github.com/julian-klode/dns66 project on GitHub and you can directly install it via F-Droid: https://f-droid.org/app/org.jak_linux.dns66, the personal fdroid repository at https://jak-linux.org/fdroid/repo (updated immediately when there is a new release), or download the apk from the github releases page: https://github.com/julian-klode/dns66/releases (or use the fdroid repository listed on github

    Android 7 notice: The DownloadManager in Nougat and newer fails to download files when a VPN service is active. This affects Play Store updates and installs, and downloads in Chrome, amongst other things. Versions 0.1.3 contains a workaround for the Play Store, but other apps might still fail to download unless the bug in Android is fixed. See https://code.google.com/p/android/issues/detail?id=213341 and https://github.com/julian-klode/dns66/issues/31#issuecomment-256695500 for further details.

    Not working? For blocking issues, send me logcat via E-Mail ([email protected]). If it worked before, send a logcat for the old version as well. Note that not all ads can be blocked via DNS, so partial ad blocking is usually not a bug - If you see requests in the logcat, that means DNS66 works correctly, and I'm not going to investigate further. Issues in UI elements and stuff like that you can just report directly (especially in preview builds).

    In-App Ad Blocking: Might or might not work. Seems Google worked around VPNs blocking the ads or something. In-Browser blocking works fine.
    18
    0.5.6 release

    0.5.6 is out.

    Highlights:
    • Improved in-app ad blocking in "system apps bypass" mode - system webview now does not bypass anymore
    • Certain DNS requests where falsely rejected in 0.5.5 due to a bug in pcap4j 1.7.1, hence upgraded to 1.7.2 - This caused Conversations to fail to connect

    All changes:
    • Release 0.5.6 -
    • Update GSON to 2.8.2 -
    • Upgrade to SDK version 26 (Oreo) - That's what I'm using now, so let's build with it.
    • Update to pcap4j 1.7.2 for aitoy/pcap4#123 - pcap4j 1.7.1 had issues parsing certain packets.
    • Allow applications to bypass the VPN themselves - This might help with #193, not sure.
    • Report stopped when stopped by third party - There seems to be a more generic life-cycle problem here, as that does not seem to be the correct solution, but it at least fixes the issue as good as possible. Really gotta do that life-cycle rework.
    • Treat system webview like a browser in 'system except browsers' - System webview widgets might be running the view in some webview UID sandbox or something, not sure, but according to #125 this solves the issue. - Fixes #125
    • Don't just crash if logcat fails - Fixes #206
    • Increase update timeouts - Increase the time out for connect to 30 seconds, and the overall execution wait thing to an hour - this one really should not be timing out in the first place, otherwise you get inconsistent results.- Fixes #207
    • Re-add external storage permissions - Some vendors like Xiaomi seem to produce horribly broken systems that require external storage permission for ACTION_CREATE_DOCUMENT with CATEGORY_OPENABLE. They just pop up a toast saying to toggle on file permissions in settings, but if we do not list file permissions in the manifest, there are none to be toggled on in settings. This does not really have any effect on other Android >= 6.0 phone, as permissions have to be requested at run-time and the manifest just specifies an upper set, but it should allow Mi users to work around their horribly broken systems.

    Needless to say I'm sad about re-adding the external storage, but there seems to be a lot of broken MIUI and custom roms out there.
    14
    Version 0.6.3 released

    Versions 0.6.2 and 0.6.3 are out

    0.6.2 changes:
    • respect order of system dns servers (#382)
    • dependency updates

    0.6.3 changes:
    • Work around bug in pcap4j crashing dns66 (#373)
    • app whitelist: Fix crash when getContext() is null (#362)
    • StartFragment: Fix icon not being shown after disconnect (#361)
    • Force notifications on Oreo and above. Use notification channels to disable notifications you don't like
    • Fix crash when vpn is restarted in some situations (#360)
    • updates: Follow redirects (#338)
    • Automatically follow night/dark mode on Android 10+ (#358)

    I hope that f-droid picks them up soon, as usual my builds are available on github and in my f-droid repo.
    14
    0.5.0 released

    I just released 0.5.0. Changes since RC1:

    Code:
    Julian Andres Klode (7):
          WhitelistFragment: Correctly display changed toggle after scroll
          Configuration: Fix reading the itemsOnVpn array
          README.md: Add link to XDA
          Switch JSON I/O from JsonReader/JsonWriter to GSON
          strings: Some formatting cleanup
          Hack in the message for incomplete updates
          version 0.5.0
    
    Julien Lepiller (1):
          French translation
    
    Naofumi Fukue (1):
          japanese translation
    
    Nikolay Buzovsky (1):
          Russian translation

    An overview of changes since the last stable release is available at

    https://github.com/julian-klode/dns66/releases/tag/v0.5.0
    13
    Julian,
    I have some ideas for your app and provided you some new blocklists. I was wondering if you could hack together pi-hole to work on our local phones or take some of their features and add it to your app.
    Please see feature request:
    https://github.com/julian-klode/dns66/issues/197
    And:
    https://github.com/julian-klode/dns66/issues/196

    I saw it, the feature request is already equivalent to two others. That said, there likely won't be any new features this year anyway (at least not from me). My requirements are satisfied as is (in app log view and quick unblock/block would be nice, but it's not essential), and I have to hand in my master's thesis in January. I'd merge reasonable, understandable pull requests with unit tests, though; and will do the occasional 0.5 point release with bug fixes and updated translations.