1.1.0 • Public • Published

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.


Grab a binary from the release section.


npm install -g dns-proxy


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


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 or

TLD Specific Nameserver

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

  "com": "",
  "dk": ""
  • This is a snippet that will go into your rc config file.

Domain Specific Nameserver

This will match all google.com and its subdomains.

  "google.com": ""
  • 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 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.

  "google.com": ""

Wildcard Domain Specific Answers

this will resolve review-someotherstring.google.com to

  "review-*.google.com": ""


Domains and Hosts support aliases now, whereby you can define a host like normal such as "hi": "" 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: '',
  logging: 'dns-proxy:query',
  nameservers: [
  servers: {},
  domains: {
    'dev': ''
  hosts: {
    'devlocal': ''
  • Note this snippet is JavaScript and rc config file format is JSON.


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


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.




Package Sidebar


npm i dns-proxy

Weekly Downloads






Unpacked Size

12.2 kB

Total Files


Last publish


  • ekristen