Code Monkey home page Code Monkey logo

dennis's Introduction

Dennis

This fork of Dennis is used to auto-switch to different DNS servers. Typically when connected to a VPN that pushes DNS servers that will only resolve specific names for specific domains.

Then you need to switch to those DNS servers only for resolving specific names, ending with specific suffixes.

It is meant to be used in conjunction with the resolver system.

Installation

Dennis is most easily installed using

$ npm install dennis

Dennis needs a configuration file, which is read from ~/.dennis.json. Then run

$ bin/dennis install

to get instructions for how dennis can be run in the background.

Configuration

An example Dennis configuration located in ~/.dennis.json looks like:

{
  "port": 53,
  "domains": {
    "restricted.example.com": {
      "host": "1.1.1.1"
    }
  },
  "default": "9.9.9.9"
}

This configuration will query 1.1.1.1 for any hostname ending with restricted.example.com and will query 9.9.9.9 for anything else.

After this, set Dennis as your default DNS server:

sudo networksetup -setdnsservers Wi-Fi "127.0.0.1"

Instead of Wi-Fi, you can use any valid macOS network service, as listed with networksetup -listallnetworkservices.

The options for the configuration are:

  • port (default: 1553) -- the port which Dennis will bind to
  • domains (required)
  • default (required)

Each key of domains (and the default one too) is a domain to proxy, for which the following options are accepted:

  • host (required) -- the host to proxy the request to
  • port (default: 53) -- the port to use
  • proto (default: udp) -- the protocol to use, udp or tcp
  • timeout (default: 1000) -- the number of milliseconds before considering the request timed out

Tear down

When stopping to use Dennis, tear it dow with this command:

launchctl unload ~/Library/LaunchAgents/dennis.plist
sudo networksetup -setdnsservers Wi-Fi "Empty"

dennis's People

Contributors

bgandon avatar bjorne avatar iconara 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.