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 许可协议。转载请注明出处!
相关文章
个人数据保全计划:(1)NAS开箱
前言 从几年前第一个硬盘故障导致参赛的文件丢失之后,我就开始意识到数据安全的重要性,开始用各种云盘做备份,当时还不是百度云一家独大,我们也都没意识到网盘备份是极其不靠谱的行为,直到因为某些不可抗力因素,一夜之间所有网盘都宣布停服,这时才意识到,数据始终是掌握在自己手中才安全可控。 随着数据量增大,我又购入一个2T硬盘,但因为不懂 + 被无良奸商坑了,买到手发现是叠瓦盘,用了一年多就频繁卡顿和丢数据
2022-11-13 · 个人数据保全计划 · 约 1 分钟
PVE折腾笔记 (3) 在原QNAP使用的硬盘上创建ZFS
QNAP硬盘换ZFS?自愈功能挺好用,但折腾Linux兼容性够闹心。LVM残留导致擦盘失败?内核对象得一个个干掉。Pool创建时参数选错?那可真是后患无穷。
2025-06-19 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:(4)基础环境配置
关闭swap 内存足够的话(8G以上),可以考虑关闭swap提高系统性能 查看开启了哪些swap cat /proc/swaps 输出 | Filename | Type | Size | Used | Priority | | ------------------------------------- | ----
2022-11-13 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:安装docker
快速开始 App Center 中安装 Container Station 然后建议先在 FileStation 里自行创建一个 Container 文件夹,这样可以控制要在哪个卷上保存 docker 的数据,我是放在固态盘上。 安装后第一次打开会提示创建 Container 共享文件夹,直接选之前创建好的 Container 目录就行。 然后全部回归命令行 默认自带 docker-compose
2022-11-13 · 个人数据保全计划 · 约 1 分钟
讨论
共 0 条加载评论中…