explaingit

pymumu/smartdns

10,817CAudience · ops devopsComplexity · 3/5LicenseSetup · moderate

TLDR

A local DNS server that queries multiple upstream servers simultaneously and returns the fastest IP address for each domain. Supports DoT, DoH, DoQ, ad blocking, and per-device rules.

Mindmap

mindmap
  root((SmartDNS))
    How it works
      Query multiple upstreams
      Speed test each IP
      Return fastest result
    Protocols
      UDP TCP standard
      DoT DoH DoQ
      Socks5 HTTP proxy
    Features
      Ad filtering
      Domain routing
      Per-client rules
      IPv4 and IPv6
    Platforms
      Raspberry Pi Linux
      OpenWrt routers
      Asus router firmware
      Windows WSL
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run SmartDNS on a Raspberry Pi or OpenWrt router to automatically return the fastest server IP for any website on your network.

USE CASE 2

Block ads and malicious domains across your entire home network by loading filter lists into SmartDNS domain rules.

USE CASE 3

Set up per-device DNS policies so children's devices use a filtered DNS while adults' devices use a different rule set.

USE CASE 4

Enable encrypted DNS queries (DoH or DoT) for your whole home network without configuring each device individually.

Tech stack

CDNSDoHDoTDoQOpenWrt

Getting it running

Difficulty · moderate Time to first run · 30min

Needs to run on a Linux system, Raspberry Pi, or OpenWrt router, and be configured as the upstream DNS for your network.

GPL v3, free to use and share, but any modifications must also be released as open source under GPL v3.

In plain English

SmartDNS is a local DNS server you run on your home network or router. When your device needs to look up a website address, SmartDNS queries multiple upstream DNS servers at the same time, measures how fast it can actually reach each returned IP address, and gives your device the fastest one. This can noticeably speed up page loads compared to using a single DNS server, because different servers sometimes return different IP addresses that vary in response time and network distance. The server supports the main DNS transport protocols: standard UDP and TCP, as well as encrypted options including DNS-over-TLS, DNS-over-HTTPS, and DNS-over-QUIC. This lets SmartDNS communicate privately with upstream servers, protecting lookup requests from being read in transit. Beyond speed, SmartDNS can block ads and malware by letting you assign specific IP addresses to specific domain names. Its domain suffix matching engine handles 200,000 filter rules in under one millisecond. You can also route different categories of domains to different upstream servers, which is useful for networks with split DNS requirements or regional routing preferences. Control is available per device: you can apply different query rules to different clients on your network based on their MAC or IP address, making it straightforward to set up parental controls or per-device content filtering without separate hardware. SmartDNS runs on standard Linux (including Raspberry Pi), OpenWrt routers, Asus router firmware, and Windows via WSL. Installation packages for these platforms can be compiled from provided build scripts. The project is open source under the GPL v3 license.

Copy-paste prompts

Prompt 1
How do I install SmartDNS on a Raspberry Pi and configure it as the primary DNS for my home network?
Prompt 2
Set up SmartDNS on OpenWrt to query Cloudflare and Google DNS simultaneously and return the fastest IP for each domain.
Prompt 3
I want to use SmartDNS to block ads by domain across my whole network. Show me how to add a blocklist and configure domain rules.
Prompt 4
Configure SmartDNS to use DNS-over-HTTPS for all upstream queries while still answering local DNS requests unencrypted.
Open on GitHub → Explain another repo

← pymumu on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.