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 许可协议。转载请注明出处!
相关文章
个人数据保全计划:部署joplin server笔记同步服务
在这个数据爆炸的时代,个人数据的价值愈发凸显,成为我们生活与工作中无可替代的重要资产。上一篇文章里,我介绍了从印象笔记迁移至 Joplin 的过程,这是我寻求数据自主掌控的关键一步。在探索同步方案时,我尝试了 OneDrive,原以为它能提供稳定高效的同步服务,可实际使用时却发现它对小文件缺乏优化,同步速度极慢,极大影响了使用体验。虽说目前还不确定是否存在数据丢失问题,但这样的效率实在难以满足我的
2025-02-02 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:从印象笔记迁移到joplin
事实上我已经很多年没用印象笔记了,上次使用似乎还是很多年前大学时,当时还开了好几年会员,用来收藏网页、微信公众号文章,挺好用的。 可惜印象笔记(evernote)从某一年开始搞了中国特供版和国际版彻底切割,吃相越来越难看,而且导出格式也改成了专有格式,越来越封闭,这不是一个好兆头,我最怕被绑定在某个平台或者生态里。
2025-01-24 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:安装Jellyfin
选择镜像:nyanmisaka/jellyfin Jellyfin中国特供版+Docker镜像,含驱动,免折腾开箱即用:https://post.smzdm.com/p/a3gw6g47/ 使用 docker-compose 部署 cd /share/Container/docker-apps/jellyfin mkdir cache config docker命令 docker run -d -
2022-11-04 · 个人数据保全计划 · 约 1 分钟
个人数据保全计划:搭建私有音乐库
下载音乐防灰,工具链折腾值不值?搭建私有流媒体,客户端体验一般般。数据自主权在手,平台下架算什么?
2023-09-29 · 个人数据保全计划 · 约 1 分钟
讨论
共 0 条加载评论中…