SmartDNS - WIP

From DD-WRT Wiki

Revision as of 18:55, 23 March 2020 by Mile-Lile (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

SmartDNS is a local DNS server. SmartDNS accepts DNS query requests from local clients, obtains DNS query results from multiple upstream DNS servers, and returns the fastest access results to clients. Avoiding DNS pollution and improving network access speed, supports high-performance ad filtering. Unlike dnsmasq's all-servers, smartdns returns the fastest access resolution

Features

  • Multiple upstream DNS servers

Support configuring multiple upstream DNS servers and query at the same time. The query will not be affected, even if there is a DNS server exception.

  • Return the fastest IP address

Supports finding the fastest access IP address from the IP address list of the domain name and returning it to the client to avoid DNS pollution and improve network access speed. A dns entry can return multiple ip addresses (youtube returns about 8). Normally the ip is selected by round robin (dnsmasq). Smartdns checks in the cache which is the fastest by tcp on a configured port (default 80), pings and returns the fastest ip by dns. It also optionally has the possibility to ignore ipv6 if its slower and returns just the fastest ipv4 address. It does constant performance checks in all entries stored in cache to return the best ip without delay.

  • Domain IP address specification

Support configuring IP address of specific domain to achieve the effect of advertising filtering, and avoid malicious websites.

  • Domain name high performance rule filtering

Support domain name suffix matching mode, simplify filtering configuration, filter 200,000 recording and take time <1ms.

  • Support IPV4, IPV6 dual stack

Support IPV4, IPV6 network, support query A, AAAA record, dual-stack IP selection, and disale IPV6 AAAA record.

  • High performance, low resource consumption

Multi-threaded asynchronous IO mode, cache cache query results.

FAQs

What is the difference between SmartDNS and DNSMASQ? Smartdns is not designed to replace DNSMASQ. The main function of Smartdns is focused on DNS resolution enhancements.

Trubleshooting

Configuration is placed at:

cat /tmp/smartdns.conf

you can use dnsutils and dig directive from client machine to check dns query time

root@laptop-pc:~$ dig dd-wrt.com
; <<>> DiG 9.10.3-P4-Debian <<>> dd-wrt.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62099
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;; dd-wrt.com.			IN	A
;; ANSWER SECTION: 
;; dd-wrt.com.		40297	IN	A	185.84.6.111
;; Query time: 82 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Mon Mar 23 19:49:41 CET 2020
;; MSG SIZE  rcvd: 55

Reference

Git Repository
Changeset