Comparing version 0.2.1 to 0.3.0
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9606
122
87