Giter Club home page Giter Club logo

hev-dns-proxy's Introduction

HevDnsProxy

A standalone DNS proxy for Android 4.3+.

Features

  • Replace dns proxy of netd.
  • Use user specific dns servers.
  • Apply any iptables rules that were set up to allow/deny access to specific UIDs (apps).
  • JNI, user specific policy.

How to Build

mkdir hev-dns-proxy
cd hev-dns-proxy
git clone git://github.com/heiher/hev-dns-proxy jni
ndk-build

How to Run

# Switch to root user
adb root
# Push executable to device
adb push hev-dns-proxy /data/hev-dns-proxy
adb shell
# Run new dns proxy in background
/data/hev-dns-proxy -p /dev/socket/hev-dns-proxy -a 8.8.8.8 -b 8.8.4.4 &
cd /dev/socket
# Change ownership and SELinux context for socket file of new dns proxy
chown root:inet hev-dns-proxy
chcon u:object_r:dnsproxyd_socket:s0 hev-dns-proxy
# Backup socket file of netd
mv dnsproxyd dnsproxyd.netd
# Enable new dns proxy
mv hev-dns-proxy dnsproxyd

Authors

License

Apache

hev-dns-proxy's People

Contributors

cernekee avatar heiher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

andsource

hev-dns-proxy's Issues

error occurs while buiding for android 4.4

[armeabi-v7a] Executable     : hev-dns-proxy
ld: error: undefined symbol: _resolv_set_nameservers_for_net
>>> referenced by main.cpp:159 (jni/src/main.cpp:159)
>>>               main.o:(main) in archive ./obj/local/armeabi-v7a/libhev-dns-proxy-library.a
>>> referenced by main.cpp:162 (jni/src/main.cpp:162)
>>>               main.o:(main) in archive ./obj/local/armeabi-v7a/libhev-dns-proxy-library.a

ld: error: undefined symbol: _resolv_flush_cache_for_net
>>> referenced by main.cpp:165 (jni/src/main.cpp:165)
>>>               main.o:(main) in archive ./obj/local/armeabi-v7a/libhev-dns-proxy-library.a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

It happens when I just changed APP_PLATFORM := android-19 in Application.mk but nothing else.
same error happens on ndk version 25.2.9519653 and 16.1.4479499 and r10e.
howerver it can be buid success with APP_PLATFORM := android-21
I'm not familar with ndk so don't know how to fix this,please help
I have an ancient TV running android 4.4, it won't send aaaa query when having global ipv6 address.
Thus visiting some pure ipv6 websites ,'net::err_ name_ not_resolved' will happen.
I have confirmd that another brand's android 4.4 device 's ipv6 works fine in same LAN.
use curl or ping6 on linux level to visit same site is ok, so i guess problem is on android level.
The most possibilty is some manufacturer's mod in netd cause getaddrinfo() have bug.
i trying to use hev-dns-proxy to repace netd's built in dns resolver to fix this problem and don't know if it will work?

[request] user friendly version

Is it possible to come up with a simple magisk module for this, I would use it with afwall+ and it would be great for controlling data usage completely. Right now I have to disable netd in afwall+ and then set up individual ip addresses for every domain I need in hosts file. Using this project afwall+ would detect correct uid in dns requests and block them per app basis...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.