Personal Data Preservation Plan: Installing a Local DNS
SmartDNS SmartDNS is a local DNS server that accepts DNS query requests from local clients, then obtains DNS query results from multiple upstream DNS servers, and returns the result with the fastest access speed to the client, thereby improving network access speed. SmartDNS also supports specifying IP addresses for particular domain names, with high-speed matching, which can achieve an ad-blocking effect. Unlike DNSmasq's all-servers, SmartDNS returns the access
目录5 个章节
SmartDNS
SmartDNS is a local DNS server that accepts DNS query requests from local clients, then obtains DNS query results from multiple upstream DNS servers, and returns the result with the fastest access speed to the client, thereby improving network access speed. SmartDNS also supports specifying IP addresses for particular domain names, with high-speed matching, which can achieve an ad-blocking effect.
Unlike DNSmasq's all-servers, SmartDNS returns the resolution result with the fastest access speed.
It supports Raspberry Pi, OpenWrt, ASUS router stock firmware, Windows, and more.
Project URL: https://github.com/pymumu/smartdns
Installing with Entware
It's available in the Entware package manager, so just install it directly
sudo opkg install smartdns
After installation, edit the config file at /opt/etc/smartdns/smartdns.conf
I copied the config file directly to my home directory and then created a symlink
This makes it convenient to open and edit it with an editor on my computer
mkdir /share/home/用户名/config/smartdns/
cd /opt/etc/smartdns/
cp smartdns.conf /share/home/用户名/config/smartdns/smartdns.conf
mv smartdns.conf smartdns.conf.bak
ln -s /share/home/用户名/config/smartdns/smartdns.conf smartdns.conf
Installing with Docker
The Docker method is recommended, as it's more convenient for management and auto-start
As usual, create a docker-compose.yml file under /share/Coutainer/softwares/smartdns with the following content
version: '3.1'
services:
smartdns:
image: ghostry/smartdns
container_name: smartdns
restart: always
volumes:
- ./smartdns:/smartdns
ports:
- 53:53/udp
Then start it with docker-compose up -d, done
The first time I deployed it, it reported that port 53 was in use. I checked with the command sudo lsof -i:53 and found that the system's built-in dnsmasq service was occupying it
I searched for a long time but couldn't find how to turn this thing off. It seems to be related to QNAP's default DHCP service
This thing's config file is at /etc/dnsmasq.conf. You can change the port to something else in there, but as everyone knows, modifying QNAP's /etc/ directory is useless—it reverts on reboot
So I had no choice but to killall -9 dnsmasq to kill the process.
Then I started the Docker version of smartdns again, done
After starting, a config file is generated under smartdns in the current directory. The default config file is already sufficient; if you want to add custom mappings, configure them according to the official documentation.
Configuration
A simple configuration
# 上游DNS配置
server 192.168.1.1
server 8.8.8.8
server 8.8.4.4
server 114.114.114.114
server 223.5.5.5
server 223.6.6.6
server 119.29.29.29
server-tcp 8.8.8.8
server-tls 8.8.8.8
server-https https://cloudflare-dns.com/dns-query
References
- Deploying smartdns with Docker to speed up DNS resolution - https://blog.dswang.ga/learning/325/
- Official GitHub - https://github.com/pymumu/smartdns
_EOF_
Personal Data Preservation Plan: Installing a Local DNS
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
PVE折腾笔记 (3) 在原QNAP使用的硬盘上创建ZFS
QNAP硬盘换ZFS?自愈功能挺好用,但折腾Linux兼容性够闹心。LVM残留导致擦盘失败?内核对象得一个个干掉。Pool创建时参数选错?那可真是后患无穷。
2025-06-19 · 个人数据保全计划 · 约 1 分钟
PVE折腾笔记 (2) 挂载之前在QNAP里使用的硬盘
QNAP硬盘数据迁移真够折腾的,RAID、DRBD、LVM层层嵌套,读出来比解方程还难。mdadm能识别但挂载失败,还得激活LVM才能看到文件,这坑比啥玩意儿。直接重做系统最省事,留原方案也行但风险不小,QTS的鸡贼设计简直让人想砸机器。
2025-06-15 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:(4)基础环境配置
关闭swap 内存足够的话(8G以上),可以考虑关闭swap提高系统性能 查看开启了哪些swap cat /proc/swaps 输出 | Filename | Type | Size | Used | Priority | | ------------------------------------- | ----
2022-11-13 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:如何安全地备份数据
呵,用mc这种上古文件管理器备份数据还沾沾自喜?rsync干校验的姿势倒是勉强及格。最后还煞有介事地生成sha256清单——这年头不会真有人手动校验冷备吧?
2025-06-16 · 个人数据保全计划 · 约 1 分钟
讨论
共 0 条加载评论中…