Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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.2.1 to 0.3.0

2

package.json
{
"name": "dns-proxy",
"version": "0.2.1",
"version": "0.3.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": {

@@ -45,3 +45,3 @@ # DNS Proxy

### Domain Specific Answers
This will match all of google.com and its subdomains and return 127.0.0.1 as the answer.
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.
```json

@@ -53,3 +53,6 @@ "domains": {

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

@@ -56,0 +59,0 @@ This is the default configuration in the application, you should override this by creating the proper rc file in one of the searchable paths.

@@ -57,5 +57,10 @@ var opts = require('rc')('dnsproxy', {

if (domain.indexOf(s) >= 0 && domain.indexOf(s) == (d_len - s_len)) {
var answer = opts.domains[s]
if (opts.domains[opts.domains[s]] != 'undefined') {
answer = opts.domains[opts.domains[s]]
}
logquery('type: server, domain: %s, answer: %s', domain, opts.domains[s]);
var res = util.createAnswer(query, opts.domains[s]);
var res = util.createAnswer(query, answer);
server.send(res, 0, res.length, rinfo.port, rinfo.address);

@@ -71,5 +76,10 @@

if (domain == h) {
var answer = opts.hosts[h]
if (opts.hosts[opts.hosts[h]] != 'undefined') {
answer = opts.hosts[opts.hosts[h]]
}
logquery('type: host, domain: %s, answer: %s', domain, opts.hosts[h]);
var res = util.createAnswer(query, opts.hosts[h]);
var res = util.createAnswer(query, answer);
server.send(res, 0, res.length, rinfo.port, rinfo.address);

@@ -76,0 +86,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc