Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

dns-proxy

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dns-proxy - npm Package Compare versions

Comparing version
0.1.1
to
0.2.0
+21
LICENSE.md
The MIT License (MIT)
Copyright (c) 2015 Erik Kristensen <erik@erikkristensen.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.ekristen.dns-proxy</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/dns-proxy</string>
<string>--config</string>
<string>/usr/local/etc/dnsproxyrc</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH</string>
<key>NODE_PATH</key>
<string>/usr/local/lib/node_modules/dns-proxy</string>
</dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/usr/local/var/log/dns-proxy/dns-proxy.log</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/dns-proxy/dns-proxy.err</string>
</dict>
</plist>
+1
-1
{
"name": "dns-proxy",
"version": "0.1.1",
"version": "0.2.0",
"description": "Simple DNS Proxy written in Node.JS. Override hosts, domains, or tlds. Redirect certain domains to different nameservers.",

@@ -5,0 +5,0 @@ "bin": {

+26
-11

@@ -7,16 +7,24 @@ # DNS Proxy

This app makes use of the [rc](https://www.npmjs.com/package/rc) module for configuration, the default configuration is below, use any file location to override the defaults.
This app makes use of the [rc](https://www.npmjs.com/package/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.
## Roadmap
* Improve configuration logging locations (ie file vs stdout)
* Service scripts for Linux and OSX
## 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
```
servers: {
'com': '8.8.8.8
```json
"servers": {
"com": "8.8.8.8"
}
```
* This is a snippet that will go into your rc config file.

@@ -26,13 +34,14 @@ ### Domain Specific Nameserver

This will match all google.com and its subdomains.
```
servers: {
'google.com': '8.8.8.8'
```json
"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.
```
domains: {
'google.com': '127.0.0.1'
```json
"domains": {
"google.com": "127.0.0.1"
}

@@ -43,3 +52,4 @@ ```

## 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.
```js
{

@@ -68,1 +78,6 @@ port: 53,

## 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.

@@ -19,2 +19,3 @@ var opts = require('rc')('dnsproxy', {

process.env.DEBUG_FD = process.env.DEBUG_FD || 1;
process.env.DEBUG = process.env.DEBUG || opts.logging;

@@ -21,0 +22,0 @@ var d = process.env.DEBUG.split(',')

Sorry, the diff of this file is not supported yet