Coder Social home page Coder Social logo

anchordns's Introduction

anchorDNS adnsLogo

anchorDNS 是一个根据IP段请求不同源的分流DNS服务器

#这能干啥?

众所周知的 CHNRoutes 项目能够修改系统路由表使拨VPN后 **IP依然直接连接,仅国外连接通过VPN以防止国内网站也通过VPN绕行。然而为了解决DNS污染,一般会让DNS解析全部走VPN到国外DNS服务器,因此上了CDN或有国外服务器的**网站 依然会解析到国外或国内非最佳服务器降低访问速度。

anchorDNS 正是为解决此问题而设计,通过先从国内DNS解析域名,若发现是**IP则直接返回结果,若非**IP则改用境外DNS解析的方法 能够既完全保持国内网站的解析正确 又获得无污染的境外网站DNS查询结果。

示例——

解析 www.baidu.com -> 同时查询114.114.114.114(直连)/8.8.8.8(走VPN) -> 发现是**IP网站 -> 使用直连114.114.114.114的结果

解析 twitter.com -> 同时查询114.114.114.114(直连)/8.8.8.8(走VPN) -> 发现非**IP网站 -> 使用走VPN的8.8.8.8的结果(无污染)

#使用姿势

去 Release 下载最新版,解压后bin目录下 带参数运行 anchorDNS

参数详解——

usage: anchorDNS
 -a,--alternativeDNS <arg>   Specify the alternative DNS server. Default:
                             8.8.8.8,8.8.4.4,208.67.222.222,208.67.220.220
 -c,--cidr <arg>             Specify the CIDR list. Default: Download from
                             IPdeny
 -d,--defaultDNS <arg>       Specify the default DNS server. Default:
                             119.29.29.29,182.254.116.116,223.5.5.5,223.6.
                             6.6
 -f,--fallback               Use alternative DNS when default DNS failed.
 -h,--help                   Show this help message.
 -i,--ip <arg>               Specify the listening IP. Default: 127.0.0.1
 -n,--nocache                Disable results cache.
 -p,--port <arg>             Specify the listening port. Default: 53
 -t,--timeout <arg>          Specify the DNS time out (sec). Default: 2
 -v,--verbose                Verbose mode.

-a 指定国外DNS服务器
-c 指定**IP CIDR表(默认会自动从IPdeny下载最新并保存为 ChinaCIDR.txt )
-d 指定国内DNS服务器
-f 当国内DNS超时或出错时也转至国外DNS
-h 显示上述帮助
-i 指定监听IP(本地请使用默认127.0.0.1)
-n 禁用查询缓存
-p 指定监听端口
-t DNS查询超时时间 单位:秒 默认为2
-v 显示每个 DNS 请求查询的情况的调试输出模式

可以直接不带任何参数使用默认值使用,也可进行自定义如: anchorDNS -d 1.2.4.8 -a 8.8.4.4 -f -c ChinaCIDR_NEW.txt

然后设置机器的DNS服务器为 127.0.0.1

**IP段的CIDR表可在此处下载更新

#技术细节

使用 dnsjava 处理DNS通信,Gradle构建,JDK1.8+

anchordns's People

Contributors

tobyxdd avatar

Watchers

 avatar

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.