[APP][2.3.5+][1.14 - 12/21/2014] DnsQache: Custom DNS + HTTP(S) Proxy

Search This thread

Titchener17

Senior Member
Jul 17, 2013
671
437
Raleigh
Forget if you need transaction id for anyreason lemme know if so made donation thank you very much for sharing this great work with everyone !
 
  • Like
Reactions: tdhite

tdhite

Senior Member
Dec 4, 2012
1,687
3,463
DFW
@tdhite does the alpha supports gb?

I'm sorry dude -- it does not. There's some specific features used in the code that don't track back to gingerbread API. If I ever find a free moment -- I'll give a shot to trying backwards compat -- but truthfully, if you're ok with the .8x versions, the fundamentals really are similar so you get all the speed up, just not the flashy UI.
 
  • Like
Reactions: killoid

user2k10

Senior Member
Sep 26, 2013
566
118
I have DNS provider set to Custom and am trying to set specific IP addresses. I leave Provider Country blank and enter the Custom Primary and Secondary Server IP addresses, but they get blanked out.

How do I blank out Provider Country or maybe I should be able to set it to custom?

@tdhite

Did you get a chance to look at this problem?
 

tdhite

Senior Member
Dec 4, 2012
1,687
3,463
DFW
@tdhite

Did you get a chance to look at this problem?

not yet -- I'll try today / tomorrow.

----------- update --------------

Took a look and I can modify it. Alas, it'll take a couple days. There is a (sick and twisted) work around. Just pick a country, then two providers. After that, literally, set your own custom provider values (don't use the lists). After that, just back out of the custom dns settings screen. Believe it or not, it will keep the custom (hand-entered) values. Drag is, next time you enter the preferences screen to reset that, DnsQache will overwrite your values with that of the list selection. That's what I have to fixup.
 
Last edited:

killoid

Senior Member
Feb 5, 2013
1,266
442
@tdhite can u tell me what does it mean 'bad line in the etc/hosts' in the log??
 

Attachments

  • dnsqache.txt
    1.2 KB · Views: 6

tdhite

Senior Member
Dec 4, 2012
1,687
3,463
DFW
@tdhite can u tell me what does it mean 'bad line in the etc/hosts' in the log??

That means something wrote bad records into your /etc/hosts file. If you are using adware, or things like that, that can happen.

What are you using other than DnaQache for mucking with hosts file entries?

Finally, that you have 547349 (probably more) lines in your /etc/hosts file is a disaster, imho. That's a ridiculous setup to be sure. Something is producing a mess for you.
 

killoid

Senior Member
Feb 5, 2013
1,266
442
That means something wrote bad records into your /etc/hosts file. If you are using adware, or things like that, that can happen.

What are you using other than DnaQache for mucking with hosts file entries?

Finally, that you have 547349 (probably more) lines in your /etc/hosts file is a disaster, imho. That's a ridiculous setup to be sure. Something is producing a mess for you.

i am using mother of all ad-blocking. maybe i should use a smaller hosts file.
 

biopsin

Senior Member
Nov 2, 2010
469
111
oslo
i am using mother of all ad-blocking. maybe i should use a smaller hosts file.
It´s a total overkill, his hosts file in current size is meant for a hostsserver or similar, load it on the router not on the device.
use the old hosts file in last crossbreeder, its small it does the main point of ad- and track blocking, fine tune it to your location and surf habits.
Optimize it with replacing every 127.0.0.1 with 0.0.0.0 except for the localhost, and further you can have 9 hosts per line(or maybe more, have not tested beyond 9), it´s undocumented bla bla - it works fine..
So a hosts file at 13830 lines = 415k drops to 1540 lines = 290k - use the ram for other things instead of wasting it on trillion domains you probably never gonna hit the next 20 years,..
 
  • Like
Reactions: killoid

tdhite

Senior Member
Dec 4, 2012
1,687
3,463
DFW
Updated 09/06/2014

Fixed up the ability to manually override the Country setting in Custom DNS (just set the Country to 'None' which is now the default value).

Always read the DISCLAIMER.

Please also read the Change Log post.

Then you can pull the update from the Download Link.

Have fun.

---------- edit ------------

Updated the link to point at DnsQache-1.12.apk to include recent fix.

----------------------------

:cool:
 
Last edited:

tdhite

Senior Member
Dec 4, 2012
1,687
3,463
DFW
I have FC when update providers

Only way I can reproduce is if I completely turn off data. That means there's a slight error handling a failed internet connection.

Please make sure you can connect to internet sites and send a logcat on further failure. Honestly, just telling me you had a problem with no way for me to debug the issue is less than optimal.

Thanks in any event.
 

tamingsarix

Senior Member
Dec 17, 2013
229
14
Only way I can reproduce is if I completely turn off data. That means there's a slight error handling a failed internet connection.

Please make sure you can connect to internet sites and send a logcat on further failure. Honestly, just telling me you had a problem with no way for me to debug the issue is less than optimal.

Thanks in any event.

Although have error, i have success update..strange
 

user2k10

Senior Member
Sep 26, 2013
566
118
Fixed up the ability to manually override the Country setting in Custom DNS (just set the Country to 'None' which is now the default value).

Always read the DISCLAIMER.

Please also read the Change Log post.

Then you can pull the update from the Download Link.

Have fun.

:cool:

It still won't save the entered custom DNS addresses. If I restart the app they default back to the Google addresses.


Sent from my Samsung S3 (GT-i9300) on Sammy JB 4.3 (NB6) powered by Boeffla kernel via Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 39
    [APP][2.3.5+][1.14 - 12/21/2014] DnsQache: Custom DNS + HTTP(S) Proxy

    Code:
    *** Disclamer: Read the [URL="http://xdaforums.com/showpost.php?p=48623656&postcount=2"]DISCLAIMER[/URL] file before committing to the use of this application.

    Introduction
    DnsQache is a custom DNS provider and content proxy manager for root enabled users. It enables the use of custom DNS name servers and content caching as well as HTTP/HTTPS Proxy and caching for Android Rooted phones. The serices provided by DnsQache can significantly accelerate Internet browsing and generally any access to network services, especially for those using tethering facilities provided by many ROMs.

    Images

    Installation instructions
    ** PREREQUISITES **

    1) A rooted Android phone with busybox -- you should know how to, and have already, rooted your phone and get busybox operational on the same phone;

    2) Your phone's kernel must be netfilter-enabled (most stock kernels support netfilter (IPTABLES), but it's a good idea to check to be sure);

    3) If using Harry Mue's and Sofia Lemons' wifi tether application, assure you use a version released after July 18, 2013.

    Custom DNS Provider and Query Caching

    To use the program for just DNS caching and redirection, install and start the program. Thereafter, check the options in the "System|Settings: DNS" menu and tune to your liking.

    The DNS cache is implemented via dnsmasq and is always active when DnsQache is active. For Android versions lower than Jelly Bean, the application manages the network settings (e.g., system properties and /etc/resolv.conf) so that all DNS requests resolve via the local dnsmasq server.

    For Android versions Jelly Bean and higher, the application sets rules via IPTABLES (http://www.netfilter.org/projects/iptables/) to redirect all DNS requests to the local dnsmasq server. In that way, DNS caching is always active when DnsQache is active. This is true whether or not the phone is being used for tethering.

    For users of the fantastic Android Wifi Tether application (https://code.google.com/p/android-wifi-tether), the authors of that application, on Jul 18, 2013, merged in code fixes submitted by the author of this program that prevents the wifi-tether application from listening on the
    localhost interface, which is required for DNS caching and not used by wifi-tether. To assure you are using the version of code in which that 'fix' exists, you should be using wifi_tether_v3_4-experimental1.apk or higher (see https://code.google.com/p/android-wifi-tether/downloads/list). Tethered users gain the benefit of dns caching as well as proxy services provided by DnsQache.

    At first, it may be a good idea to turn on 'Log Queries' in the DNS settings. That will allow you to view all DNS queries made by your phone and the endpoint to which the queries were redirected. To see those, you can use logcat (or an application that displays the same) or use the "System|View Log" menu, the latter of which will take a snapshot of the existing logcat log as it relates to dnsmasq and present the information. If no log shows (e.g., the log says the log file is not available), then it means you did not turn on Log Queries and restart the service, or the service failed due to bad settings. The most common issue there is if you use custom IP addresses for the DNS name servers and dnsmasq ultimately fails to start due to such configuration error.

    Using the HTTP/HTTPS Proxy

    Generally, for proxy use, clients (your laptop for example) can connect via wifi to your phone, when tethering, and get access to the internet using the mobile connection (4G, 3G, 2G) of your phone. That may occur through custom ROMs as native hotspot or via the wifi-tether application. When DnsQache is active, custom DNS name servers and caching is automatically enabled for tethered users as well as the phone.

    To use proxy services, chech the values in the "System|Settings: Proxy" menu. Once saved, the options will take effect only after the service is (re)started. To restart, simply 'stop' and 'start' the DnsQache service. To do that, return to the main page of the app and the big 'DQ' will be either green or grey. If grey, it means the service is not currently running, so just touch the DQ to start it. If green (and you need to restart), just touch the DQ and give it time to shut down (goes grey) and touch it again (start).

    The Proxy settings allow for the use of either polipo (http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/) or tinyproxy (https://banu.com/tinyproxy/). Tinyproxy does not perform page caching, as does polipo, so the general preference ends up use of polipo.

    The settings require that you to specify one or more CIDR ranges for client addresses allowed to connect to the proxy. The CIDRs of interest generally are the network addresses (e.g., 172.20.21.0/24) of your mobile hotspot (tether) network. You can view that in your phone settings, or the settings of your wifi-tether application. DnsQache sets the proxy connection port to 3128, so any client you want to proxy *must* set the proxy port to 3128. A later release will allow changing the port.

    To have tethered users go through the proxy instead of directly NATed connection through the phone, the tethered user must set their device (computer, et al) to use a proxy. Set the proxy settings to use the IP address of your tethering gateway (the IP address of your wifi when tethering -- usually that is the ".1" address of the CIDR you specified for your client addresses for tethering or mobile hotspot application). As noted, when using the polipo proxy, proxy caching of content takes place on the phone, though secured pages (HTTPS) should not end up cached.

    Download
    Download links are below in the Disclaimer Post, after the disclaimer (which you should read). That post will be kept up to date and includes the legal necessities with distributing an application.

    ** Source Code **
    The sources for the application are available on GitHub -- feel free to fork it and send pull requests as you see fit.

    Changelog

    FAQ
    Trying to figure out what to set for the maximum DNS cache size?
    A nice rule of thumb is try 200 or 300 on JB and above, see how that works for you. On older Android (less than Jelly Bean), give it some room, like 1000, and see how that works, tune if necessary. The cache data is not all that much, so you're not stealing all that much RAM. Read more about that in this post if you're interested.

    Thanks To/Credits
    The author of this program would like to thank Harry Mue and Sofia Lemons for the fantastic Android Wifi Tether application for its use in both using that application and and in learning Android. Some of the code in DnsQache borrow from ideas and indeed implementation from Harry's and Sofia's code base, therefore this body of code carries his license and Copyright (duly noted in the DISCLAIMER.txt and the code, where appropriate).

    The front page, and indeed the service layer code was inspired by, and to some extent, borrows from the venerable android-wifi-tether project originally authored by Harry Mue (harald.mue@gmail.com) and Sofia Lemons. While so inspired, obviously DnsQache is different in its nature and thus the code is quite different as a whole. Still -- reading and contributing to Harry's and Sofia's code was what got things rolling, so that body of work deserves significant mention, and that exists also in the sources.

    XDA:DevDB Information
    DnsQache, App for the Apps & Games

    Contributors
    tdhite
    Source Code: https://github.com/Android-Apps/DnsQache


    Version Information
    Status: Stable
    Current Stable Version: 1.14
    Stable Release Date: 2014-12-21

    Created 2014-12-21
    Last Updated 2014-12-21
    18
    Disclaimer and Download Link

    *** Legal Disclaimer -- READ ALL OF THE FOLLOWING ***

    The Download Links Are After This Disclaimer Information


    If you use the software, or convey it to someone else, you and all subsequent conveyees are bound by the following:

    This work is partially based on the work by Harry Mue and Sofia Lemons (mailto: harald.mue@gmail.com) as it relates to Service management Though only a minor basis, DnsQache none the less acknowledges that body of work, and carries all of the disclaimers also inherent therein. See https://code.google.com/p/android-wifi-tether/ for more.

    LEGAL DISCLAIMERS AND ASSUMPTION OF THE RISK BY THE USER OF THIS PROGRAM

    Assumption of the Risk of Use
    YOU ASSUME, AND AGREE TO ASSUME, ALL THE RISK OF HARM BY USING THIS PROGRAM. THIS PROGRAM MAY VOID YOUR WARRANTY WITH A THIRD PARTY, IT MAY IMPROPERLY OPERATE AND DAMAGE YOUR DEVICE, IT MAY CAUSE ANY MYRIAD OF HARMFUL OUTCOMES REGARDING YOUR DEVICE OR THE USE OF THE DEVICE ON WHICH IT GETS INSTALLED. YOU ACKNOWLEDGE THAT YOU ARE AWARE OF THOSE RISKS, UNDERSTAND THOSE RISKS, AND VOLUNTARILY AND INTELLIGENTLY ELECT TO ENGAGE THOSE RISKS BY USING THE PROGRAM.

    Disclaimer of Warranty
    THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME ALL LIABILITY AND AGREE THAT IN NO EVENT WILL YOU SEEK ANY FORM OF RECOMPENSE, WHETHER LEGAL OR EQUITABLE, INCLUDING BUT NOT LIMITED TO NECESSARY SERVICING, REPAIR, CORRECTION OR OTHERWISE.

    Limitation of Liability
    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM, PERMITTED OR NOT, BE LIABLE TO YOU FOR LEGAL DAMAGES OR EQUITABLE RELIEF, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


    DOWNLOAD LINKS:
    DnsQache 1.14 - PIE (Lollipop) Support
    MD5 Checksum: c4939d4a8f09e66ce9ea8645a6499f97

    DnsQache 1.13
    MD5 Checksum: 3549c7732613e3a0963f15efb0cf3562

    Version 0.85 (for pre-Android 3.0 users): dnsqache.apk
    MD5 Checksum: f05161d291ec47ca1fbed95a10356908 dnsqache.apk
    9
    Updated 12/21/2014 -- PIE (Lollipop) Support

    Title of the post says it all -- updated, fresh and minty clean!

    To see the changes, please read the Change Log post.

    Download the update from the Download Post.

    Have fun.

    What's in the new one -- PIE executables, so now works with Lollipop.

    :good:
    7
    Update's a-coming ...

    Hi all -- sorry for delays (works been a bear). Update is in testing, having a few glitches. I now build my own custom Cyanogenmod 11 ROM and kernel, and that's where I test things. Also testing on HTC Sense 6 ROMs.

    It's close -- just have some FCs to clean up (all regarding handling of getting DnsProviders dynamically off the Internet), but they're not difficult.

    It'll be fine, just hang with me a few more days.
    7
    super excited 4 whenever its good and ready thank you again for such an awesome app !

    So very sorry folks -- just slammed to the hilt at work.

    With that said:

    https://www.androidfilehost.com/?fid=95916177934542665

    That will get you there for a bit. Beware, as I noted, it is not optimal given the size of data it now retrieves. I need to overhaul the settings in the Custom DNS area. Most US folks should just pick a non-custom for now, unless you're willing to wait on the download and subsequent delay pulling up Settings.

    So, keep these complaints away for now:

    1) Updating providers will take a good long time -- use WiFi for that. Don't use mobile data (costs at hand as well as speeds);

    2) Opening Settings will delay a bit as it reads the database.

    Fixes coming soon enough, just have to get there. Work should be settling soon.