Git Product home page Git Product logo

dns-proxy's Introduction

DNS Proxy

DNS proxy is a type of server you can connect to which spoofs your location, so you can access content which has been restricted in the region you're actually in.

Run

go build

If you have goland installed in your system, simply download packages and run application by:

go get ./...
go run main.go

docker

  1. build docker

    docker build -t dns-proxy .
  2. create docker container:

    docker run -itd \
      -v /path/to/config.json:/dns-proxy/config.json \
      -p 53:53/udp \
      -p 80:80 \
      -p 443:443 \
      --name=dns dns-proxy

    make sure port 53, 80 and 443 are free for service to listen


  • If you're getting error for port 53 that is already in use try:
sudo systemctl stop systemd-resolved

if it didn't work, try

sudo lsof -i :53

then try to stop services listening to port 53(for example sudo systemctl stop dbsmasq)

Configuration

You create configuration like sample file existing named config.sample.json.

Remember setup domain value as your server IP address so clients resolve the host name with your server address.

sample config file:

{
  "dnsServerHost": "0.0.0.0:53",
  "dnsServers": [
    "8.8.8.8:53"
  ],
  "domains": {
    "test.com": "127.0.0.1"
  },
  "servers": [
    {
      "scheme": "http",
      "host": "0.0.0.0",
      "port": "80"
    },
    {
      "scheme": "https",
      "host": "0.0.0.0",
      "port": "443"
    }
  ]
}
  1. dnsServerHost > 0.0.0.0:53: dns server address
  2. dnsServers > ["8.8.8.8:53"]: secondary dns servers so be able to resolve all other domains as it supposed to be resolved
  3. domains > {domain: your server ip}: remember to set the server IP address which you want to proxy request from. e.g. {"test.com": "192.168.1.6"} test.com is the domain of website which you want to proxy through server and 192.168.1.6 would be IP address of the proxy server.
  4. servers: would be proxy servers of service which enables configurations of exposing port and IP address for further configurations like putting nginx as main router of requests.

dns-proxy's People

Contributors

8ae8 avatar

Watchers

James Cloos avatar  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.