Giter Site home page Giter Site logo

smartdns's Introduction

En | 中文简体

smartDNS (based on overture)


Build Status GoDoc Go Report Card

smartDNS is a smart DNS server/forwarder/dispatcher written in Go.

smartDNS based on overture.

Please note: If you are using the binary releases, please follow the instructions in the README file with corresponding git version tag. The README in master branch are subject to change and does not always reflect the correct instructions to your binary release version.

Features

  • Support DNSbunch(All DNS bundle)
  • Support DNSbundle(A group of similar DNS server) example: HK-DNS, CN-DNS, US-DNS
  • Support DNS cache update automatically(FastTable)
  • Dispatcher
    • Custom domain
    • Custom IP network

Dispatch process

Overture can force custom domain DNS queries to use selected DNS when applicable.

For custom IP network, overture will query the domain with primary DNS firstly. If the answer is empty or the IP is not matched then overture will finally use the alternative DNS servers.

Structure

Installation

You can download binary releases from the release.

Usages

Start with the default config file -> ./config.json

$ ./smartDNS

Or use your own config file:

$ ./smartDNS -c /path/to/config.json

Verbose mode:

$ ./smartDNS -v

Log to file:

$ ./smartDNS -l /path/to/overture.log

For other options, please see help:

$ ./smartDNS -h

Tips:

  • Root privilege is required if you are listening on port 53.

Configuration Syntax

Configuration file is "config.json" by default:

{
  "BindAddress": ":53",
  "DebugHTTPAddress": "127.0.0.1:5555",
  "DNSBunch": {
    "HK-DNS": [
      {
        "Name": "Microsoft-HK",
        "Address": "47.91.128.195:53",
        "Protocol": "udp",
        "SOCKS5Address": "",
        "Timeout": 6,
        "EDNSClientSubnet": {
          "Policy": "disable",
          "ExternalIP": "",
          "NoCookie": false
        }
      },
      {
        "Name": "Google-HK",
        "Address": "8.8.8.8:53",
        "Protocol": "udp",
        "SOCKS5Address": "",
        "Timeout": 3,
        "EDNSClientSubnet": {
          "Policy": "enable",
          "ExternalIP": "",
          "NoCookie": false
        }
      }
    ],
    "CN-DNS": [
      {
        "Name": "ChinaTelecom-CN",
        "Address": "114.114.114.114:53",
        "Protocol": "udp",
        "SOCKS5Address": "",
        "Timeout": 6,
        "EDNSClientSubnet": {
          "Policy": "disable",
          "ExternalIP": "",
          "NoCookie": false
        }
      },
      {
        "Name": "Baidu-CN",
        "Address": "180.76.76.76:53",
        "Protocol": "udp",
        "SOCKS5Address": "",
        "Timeout": 6,
        "EDNSClientSubnet": {
          "Policy": "disable",
          "ExternalIP": "",
          "NoCookie": false
        }
      }
    ]
  },
  "DNSFilter": {
    "HK-DNS": {
      "IPNetworkFile": "",
      "DomainFile": "configuration/hk.domain",
      "Matcher": "regex-list"
    },
    "CN-DNS": {
      "IPNetworkFile": "",
      "DomainFile": "configuration/cn.domain",
      "Matcher": "regex-list"
    }
  },
  "IPv6UseAlternativeDNS": false,
  "HostsFile": "./hosts",
  "MinimumTTL": 0,
  "DomainTTLFile": "./domain_ttl_sample",
  "CacheSize": 0,
  "RejectQType": [
    255
  ]
}```

Acknowledgements

License

This project is under the MIT license. See the LICENSE file for the full license text.

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.