SmartDNS - WIP

From DD-WRT Wiki

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



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.


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


To enable SmartDNS go to <router_ip>/Services.asp and simply check Enable SmartDNS Resolver.



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.


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
; <<>> DiG 9.10.3-P4-Debian <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62099
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
; EDNS: version: 0, flags:; udp: 4096
;;			IN	A
;;		40297	IN	A
;; Query time: 82 msec
;; WHEN: Mon Mar 23 19:49:41 CET 2020
;; MSG SIZE  rcvd: 55


Git Repository