• Stars
    star
    195
  • Rank 199,374 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple DNS Proxy written in Node.JS. Override hosts, domains, or tlds. Redirect certain domains to different nameservers.

CircleCI npm npm David David

DNS Proxy

Simple DNS Proxy written in Node.JS

Designed to allow you to override hosts or domains with specific answers or override tlds, or domains to use different nameservers. Useful when using VPN connections with split DNS setups.

This app makes use of the rc module for configuration, the default configuration is below, use any file location to override the defaults. Appname is dnsproxy when creating a configuration file.

I can guarentee this app isn't perfect but fulfills my current needs for routing certain domains to private IP name servers when on VPN.

Install

Grab a binary from the release section.

OLD METHOD

npm install -g dns-proxy

Features

  • Override nameservers for TLD
  • Override nameservers for Domain
  • Set IP for entire domain or TLD. (example: if you want to answer 192.168.11.1 for local.dev)
  • Set IP for host
  • Wildcard Support

Examples

For nameserver overrides if an answer isn't received by a threshold (350ms by default) DNS proxy will fallback to one of the default nameservers provided in the configuration (by default 8.8.8.8 or 8.8.4.4)

TLD Specific Nameserver

This will send all .com queries to 8.8.8.8 and .dk queries to 127.0.0.1 and custom port 54.

"servers": {
  "com": "8.8.8.8",
  "dk": "127.0.0.1:54"
}
  • This is a snippet that will go into your rc config file.

Domain Specific Nameserver

This will match all google.com and its subdomains.

"servers": {
  "google.com": "8.8.8.8"
}
  • This is a snippet that will go into your rc config file.

Domain Specific Answers

This will match all of google.com and its subdomains and return 127.0.0.1 as the answer. This technically doens't even have to be a real domain or a full domain, if you configure ogle.com and do a lookup on google.com, the ogle.com will match.

"domains": {
  "google.com": "127.0.0.1"
}

Wildcard Domain Specific Answers

this will resolve review-someotherstring.google.com to 127.0.0.1

"domains": {
  "review-*.google.com": "127.0.0.1"
}

Aliases

Domains and Hosts support aliases now, whereby you can define a host like normal such as "hi": "127.0.0.1" and in another entry reference it like "hello": "hi".

Default Configuration

This is the default configuration in the application, you should override this by creating the proper rc file in one of the searchable paths.

{
  port: 53,
  host: '127.0.0.1',
  logging: 'dns-proxy:query',
  nameservers: [
    '8.8.8.8',
    '8.8.4.4'
  ],
  servers: {},
  domains: {
    'dev': '127.0.0.1'
  },
  hosts: {
    'devlocal': '127.0.0.1'
  }
}
  • Note this snippet is JavaScript and rc config file format is JSON.

Logging

Logging is handled by the simple lightweight debug package. By default all queries are logged. To change the logging output update the logging variable to any of the following: dns-proxy:error, dns-proxy:query, dns-proxy:debug. You can specify all or none, separate using a comma, a wildcard can be used as well.

Running as a Service

OSX

You can copy the resources/launchd.plist file into /Library/LaunchDaemons as com.github.ekristen.dns-proxy.plist. To start just run sudo launchctl load /Library/LaunchDaemons/com.github.ekristen.dns-proxy.plist. This will also make the dns-proxy service to start on boot.

More Repositories

1

cast

Cast is an installer for any compatible Saltstack based distribution like SIFT or REMnux
Go
97
star
2

docker-index

Open Source Docker Index (aka Docker Hub) written in Node.JS
JavaScript
93
star
3

docker-openvpn-client

OpenVPN Client for Docker
41
star
4

aws-nuke

Remove all the resources from an AWS account
Go
39
star
5

azure-nuke

Remove all resources from an Azure Tenant and it's Subscriptions.
Go
32
star
6

node-vault-js

Pure Javascript Vault Client
JavaScript
24
star
7

openvpn-router

Monitors a docker openvpn-client and creates routes and iptable rules for proper network routing through the VPN
JavaScript
23
star
8

node-module-registry

An open source node module registry compatible with the NPM client
JavaScript
22
star
9

libnuke

Common Golang Packages for use by the Various Cloud Nuke Tools
Go
20
star
10

consul-template-plugin-savetofile

Consul Template Plugin to Write Data to Separate Files
Go
16
star
11

mythboxee

The seamless blending of MythTV and Boxee
Python
14
star
12

node-github-cache

Provides transparent caching for node-github api calls
JavaScript
14
star
13

terraform-provider-pgp

Terraform Provider for PGP Actions
Go
12
star
14

dockit

Docker Registry Authentication Made Simple
Go
10
star
15

docker-index-cli

Command Line Tool for the Docker Index Project
JavaScript
9
star
16

pipeliner

Next Generation Pipeline Engine. Leverages GitLab Runner and the GitLab CI YAML Configuration.
Go
9
star
17

gorm-libsql

Go
8
star
18

prometheus-client

Pure Javascript Node.JS Prometheus Client for Metric Instrumentation
JavaScript
7
star
19

docker-cache

Use redis to cache details about your docker hosts, images and containers, inspired by github.com/samalba/docker-cache
JavaScript
7
star
20

node-libkv

Standardized KV API for Multiple Key/Value Backends
JavaScript
6
star
21

gitlab-release

Publish Assets to GitLab Release from GitLab CI - This is a MIRROR
Shell
6
star
22

unboxed

A set of tools wrapped into an application for the Boxee Box that makes using the Box to its full potential easier
Python
6
star
23

docker-volume-vault-pki

A docker volume plugin that requests a PKI secret from Vault and writes the response to a volume for the container to mount.
Go
5
star
24

endpointer

Declarative HTTP Endpoint Manager with Auto Generating Documentation
JavaScript
5
star
25

go-project-template

Opinionated Go Project Template
Go
3
star
26

salt-teleport

SaltStack Teleport Module and State Functions
Python
3
star
27

passport-replicated

A Passport.JS Authentication Strategy for Replicated Identity API
JavaScript
3
star
28

restify-endpoints

Endpoint Manager for RESTify (Node.JS)
JavaScript
3
star
29

modella-level

Modella LevelDB Middleware
JavaScript
3
star
30

queryable

Local DNS resolver for docker containers
Go
2
star
31

level-snapshot

Takes snapshots and maintains a transactional log since the snapshot, allows for replication via snapshots and the logs
JavaScript
2
star
32

Salesforce-Webform-Integration

Allows for seemless Salesforce integration with Webforms in Drupal 7
PHP
2
star
33

gcp-nuke

Nuke Everything in GCP Project
Go
2
star
34

docker-plugin-multilogger

A docker multilogger as a plugin. Implements jsonlog + splunk loggers.
Go
2
star
35

node-consul-kv-cache

This library turns each key change received into an node emitted event, and keeps track so duplicates are not sent
JavaScript
2
star
36

alertmanager-controller

A Prometheus Alertmanager Operator - Create Silences from Kubernetes Resource
Go
2
star
37

docker-event-bridge

Bridges Docker Events to Consul
Go
2
star
38

gitlab-curator

A CLI tool designed to help curate GitLab Issues and Merge Requests
Go
2
star
39

terraform-provider-git

Go
1
star
40

icinga2-plugin-consul

An Icinga2/Nagios Compatible Plugin for Checking Consul Service Checks written in Go
Go
1
star
41

docker-cache-ui

UI for viewing data populated by github.com/ekristen/docker-cache
1
star
42

leveldb-server

JavaScript
1
star
43

connect-postgrest-session

Connect/Express Session Store using PostgREST
JavaScript
1
star
44

docker-cache-app

Implements github.com/ekristen/docker-cache into a usable and configurable application to monitor a single or multiple docker hosts simultaneously
1
star
45

docker-index-nginx

Reverse Nginx Proxy for a Private Docker Index + Registry Setup
Shell
1
star
46

restifyit

RESTful API framework built on top of node-restify
JavaScript
1
star
47

cloud-provider-zero

Cloud Provider Zero - Cloud Provider Goodness without the cruft
Go
1
star
48

boilerplate-typescript-api

My preferred starting boilerplate for a TypeScript based API project
TypeScript
1
star
49

openvpn-registrator

Registers OpenVPN clients using the status file as services in Consul
JavaScript
1
star
50

node-phpjs

Port of the PHP.js project for use in Node.JS
JavaScript
1
star
51

coredns-xip

Go
1
star
52

stackato-mqmgmt-proxy

Creats an HTTP(s) proxy to the first RabbitMQ service attached to it in Stackato
JavaScript
1
star
53

helm-charts

Curated Helm Charts
Smarty
1
star
54

metalsmith-feed-js

Native Javascript Metalsmith RSS Feed Generator
JavaScript
1
star
55

aws-smtp-credentials

Converts an AWS Secret Key to SMTP Password
JavaScript
1
star