智能dns服务器、自建DNS服务器、自架DNS服务器、DNS分流

2024-03-08 06:20

本文主要是介绍智能dns服务器、自建DNS服务器、自架DNS服务器、DNS分流,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

smart安装链接
[https://github.com/pymumu/smartdns/releases](https://github.com/pymumu/smartdns/releases)
wget https://github.com/pymumu/smartdns/releases/download/all-best-ip/smartdns.1.2022.05.03-1046.x86_64-linux-all.tar.gz[root@localhost ~]# ls
anaconda-ks.cfg  initial-setup-ks.cfg  smartdns.1.2022.05.03-1046.x86_64-linux-all.tar.gz
[root@localhost ~]# tar zxf  smartdns.1.2022.05.03-1046.x86_64-linux-all.tar.gz
[root@localhost ~]# tar zxf  smartdns.1.2022.05.03-1046.x86_64-linux-all.tar.gz
[root@localhost ~]# cd smartdns
[root@localhost smartdns]# chmod +x ./install
[root@localhost smartdns]# ./install -i
install: 正在创建目录"/etc/smartdns"
"usr/sbin/smartdns" -> "/usr/sbin/smartdns"
"etc/smartdns/smartdns.conf" -> "/etc/smartdns/smartdns.conf"
"etc/default/smartdns" -> "/etc/default/smartdns"
"etc/init.d/smartdns" -> "/etc/init.d/smartdns"
"systemd/smartdns.service" -> "/usr/lib/systemd/system/smartdns.service"
Created symlink from /etc/systemd/system/smartdns.service to /usr/lib/systemd/system/smartdns.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/smartdns.service to /usr/lib/systemd/system/smartdns.service.
[root@localhost smartdns]# vi /etc/smartdns/smartdns.confsystemctl enable smartdns
systemctl start smartdns

飞书收集

#飞书
.feishu.cn
.q9jvw0u5f5.feishu.cn
.ccm-frontier.feishu.cn
.internal-api.feishu.cn
.hryn145hsh.feishu.cn
.internal-api-drive-stream.feishu.cn
.internal-api-lark-api.feishu.cn
.slardar-bd.feishu.cn
.ccm-frontier-hl.feishu.cn
.mcs-bd.feishu.cn
.feishucdn.com
.sf3-scmcdn2-cn.feishucdn.com
.s1-imfile.feishucdn.com 
.sf6-scmcdn-cn.feishucdn.com
.ai.feishu.com
.lf9-img-sign.bytehwm.com
.lf3-short.ibytedapm.com
.mon.zijieapi.com
#百度
.baidu.com 
#京东
.jd.com
#阿里
#淘宝
.taobao.com
#wechat
.weixin.qq.com
.qq.com
.wechat.com
.wx.qq.com
#csdn
.csdn.net 

配置文件

vi /etc/smartdns/smartdns.conf# dns server name, default is host name
# server-name,
# example:
server-name smartdns1
## Include another configuration options
# conf-file [file]
# conf-file blacklist-ip.conf# dns server bind ip and port, default dns server port is 53, support binding multi ip and port
# bind udp server
#   bind [IP]:[port] [-group [group]] [-no-rule-addr] [-no-rule-nameserver] [-no-rule-ipset] [-no-speed-check] [-no-cache] [-no-rule-soa] [-no-dualstack-selection]
# bind tcp server
# option:
#   -group: set domain request to use the appropriate server group.
#   -no-rule-addr: skip address rule.
#   -no-rule-nameserver: skip nameserver rule.
#   -no-rule-ipset: skip ipset rule.
#   -no-speed-check: do not check speed.
#   -no-cache: skip cache.
#   -no-rule-soa: Skip address SOA(#) rules.
#   -no-dualstack-selection: Disable dualstack ip selection.
#   -force-aaaa-soa: force AAAA query return SOA.
# example:
#  IPV4:
#    bind :53
#    bind :6053 -group office -no-speed-check
#  IPV6:
#    bind [::]:53
#    bind-tcp [::]:53
bind [::]:53# tcp connection idle timeout
# tcp-idle-time [second]# dns cache size
# cache-size [number]
#   0: for no cache
cache-size 4096# enable persist cache when restart
# cache-persist yes# cache persist file
# cache-file /tmp/smartdns.cache# prefetch domain
# prefetch-domain [yes|no]
#启用域名预获取
prefetch-domain yes# cache serve expired
# serve-expired [yes|no]
#启用过期缓存服务
serve-expired yes# cache serve expired TTL
# serve-expired-ttl [num]
#
serve-expired-ttl 0# reply TTL value to use when replying with expired data
# serve-expired-reply-ttl [num]
# serve-expired-reply-ttl 30# List of hosts that supply bogus NX domain results
# bogus-nxdomain [ip/subnet]# List of IPs that will be filtered when nameserver is configured -blacklist-ip parameter
# blacklist-ip [ip/subnet]# List of IPs that will be accepted when nameserver is configured -whitelist-ip parameter
# whitelist-ip [ip/subnet]# List of IPs that will be ignored
# ignore-ip [ip/subnet]# speed check mode
# speed-check-mode [ping|tcp:port|none|,]
# example:
#测速模式选择,一般只检测两种协议
#   speed-check-mode ping,tcp:80speed-check-mode tcp:443,ping
#   speed-check-mode none# force AAAA query return SOA
# force-AAAA-SOA [yes|no]
#禁用IPV6解析
force-AAAA-SOA yes# force specific qtype return soa
# force-qtype-SOA [qtypeid |...]
# force-qtype-SOA 65 28# Enable IPV4, IPV6 dual stack IP optimization selection strategy
# dualstack-ip-selection-threshold [num] (0~1000)
# dualstack-ip-selection [yes|no]
dualstack-ip-selection no# edns client subnet
# edns-client-subnet [ip/subnet]
# edns-client-subnet 192.168.1.1/24
# edns-client-subnet [8::8]/56# ttl for all resource record
# rr-ttl: ttl for all record
# rr-ttl-min: minimum ttl for resource record
# rr-ttl-max: maximum ttl for resource record
# tr-ttl-reply-max: maximum reply ttl for resource record
# example:
#设置TTL最小值和最大值
#rr-ttl 300
rr-ttl-min 60
rr-ttl-max 86400
# rr-ttl-reply-max 60# set log level
# log-level: [level], level=fatal, error, warn, notice, info, debug
# log-file: file path of log file.
# log-size: size of each log file, support k,m,g
log-num: number of logs
log-level info
log-file /var/log/smartdns.log
log-size 128k
# dns audit
# audit-enable [yes|no]: enable or disable audit.
# audit-enable yes
# audit-SOA [yes|no]: enable or disable log soa result.
# audit-size size of each audit file, support k,m,g
# audit-file /var/log/smartdns-audit.log
# audit-size 128k
# audit-num 2# certificate file
# ca-file [file]
# ca-file /etc/ssl/certs/ca-certificates.crt# certificate path
# ca-path [path]
# ca-path /etc/ss/certs# remote udp dns server list
# server [IP]:[PORT] [-blacklist-ip] [-whitelist-ip] [-check-edns] [-group [group] ...] [-exclude-default-group]
# default port is 53
#   -blacklist-ip: filter result with blacklist ip
#   -whitelist-ip: filter result whth whitelist ip,  result in whitelist-ip will be accepted.
#   -check-edns: result must exist edns RR, or discard result.
#   -group [group]: set server to group, use with nameserver /domain/group.
#   -exclude-default-group: exclude this server from default group.
# server 8.8.8.8 -blacklist-ip -check-edns -group g1 -group g2#飞书
server 114.114.114.114 -group feishu -exclude-default-group
nameserver /.feishu.cn/feishu
nameserver /.feishucdn.com/feishu
nameserver /.feishu.com/feishu
nameserver /.bytehwm.com/feishu
nameserver /.ibytedapm.com/feishu
nameserver /.zijieapi.com/feishu
nameserver /.feelgood.cn/feishu
# 百度
server 114.114.114.114 -group baidu -exclude-default-group
nameserver /.baidu.com/baidu
#京东
server 114.114.114.114 -group jd -exclude-default-group
nameserver /.jd.com/jd
#淘宝天猫
server 114.114.114.114 -group taobao -exclude-default-group
nameserver /.taobao.com/taobao
nameserver /.tmall.com/taobao
#阿里
server 114.114.114.114 -group ali -exclude-default-group
nameserver /.aliyun.com/ali
#csdn
server 114.114.114.114 -group csdn -exclude-default-group
nameserver /.csdn.net/csdn
#华为
server 114.114.114.114 -group huawei -exclude-default-group
nameserver /.huaweicloud.com/huawei
#todesk
server 114.114.114.114 -group todesk  -exclude-default-group
nameserver /.todesk.com/todesk
#QQ
server 114.114.114.114 -group qq -exclude-default-group
nameserver /.qq.com/qq# remote tcp dns server list
# server-tcp [IP]:[PORT] [-blacklist-ip] [-whitelist-ip] [-group [group] ...] [-exclude-default-group]
# default port is 53
# server-tcp 8.8.8.8
server 8.8.8.8
server 8.8.4.4
##server 120.53.129.197
##server 124.70.4.50# remote tls dns server list
# server-tls [IP]:[PORT] [-blacklist-ip] [-whitelist-ip] [-spki-pin [sha256-pin]] [-group [group] ...] [-exclude-default-group]
#   -spki-pin: TLS spki pin to verify.
#   -tls-host-verify: cert hostname to verify.
#   -host-name: TLS sni hostname.
#   -no-check-certificate: no check certificate.
# Get SPKI with this command:
# default port is 853
server-tls 8.8.8.8
server-tls 1.0.0.1# remote https dns server list
# server-https https://[host]:[port]/path [-blacklist-ip] [-whitelist-ip] [-spki-pin [sha256-pin]] [-group [group] ...] [-exclude-default-group]
#   -spki-pin: TLS spki pin to verify.
#   -tls-host-verify: cert hostname to verify.
#   -host-name: TLS sni hostname.
#   -http-host: http host.
#   -no-check-certificate: no check certificate.
# default port is 443
server-https https://cloudflare-dns.com/dns-query# specific nameserver to domain
# nameserver /domain/[group|-]
# nameserver /www.example.com/office, Set the domain name to use the appropriate server group.
# nameserver /www.example.com/-, ignore this domain# specific address to domain
# address /domain/[ip|-|-4|-6|#|#4|#6]
# address /www.example.com/1.2.3.4, return ip 1.2.3.4 to client
# address /www.example.com/-, ignore address, query from upstream, suffix 4, for ipv4, 6 for ipv6, none for all
# address /www.example.com/#, return SOA to client, suffix 4, for ipv4, 6 for ipv6, none for all# enable ipset timeout by ttl feature
# ipset-timeout [yes]# specific ipset to domain
# ipset /domain/[ipset|-]
# ipset /www.example.com/block, set ipset with ipset name of block
# ipset /www.example.com/-, ignore this domain# set domain rules
# domain-rules /domain/ [-speed-check-mode [...]]
# rules:
#   [-c] -speed-check-mode [mode]: speed check mode
#                             speed-check-mode [ping|tcp:port|none|,]
#   [-a] -address [address|-]: same as address option
#   [-n] -nameserver [group|-]: same as nameserver option
#   [-p] -ipset [ipset|-]: same as ipset option
#   [-d] -dualstack-ip-selection [yes|no]: same as dualstack-ip-selection option

这篇关于智能dns服务器、自建DNS服务器、自架DNS服务器、DNS分流的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/786282

相关文章

ElasticSearch+Kibana通过Docker部署到Linux服务器中操作方法

《ElasticSearch+Kibana通过Docker部署到Linux服务器中操作方法》本文介绍了Elasticsearch的基本概念,包括文档和字段、索引和映射,还详细描述了如何通过Docker... 目录1、ElasticSearch概念2、ElasticSearch、Kibana和IK分词器部署

部署Vue项目到服务器后404错误的原因及解决方案

《部署Vue项目到服务器后404错误的原因及解决方案》文章介绍了Vue项目部署步骤以及404错误的解决方案,部署步骤包括构建项目、上传文件、配置Web服务器、重启Nginx和访问域名,404错误通常是... 目录一、vue项目部署步骤二、404错误原因及解决方案错误场景原因分析解决方案一、Vue项目部署步骤

Linux流媒体服务器部署流程

《Linux流媒体服务器部署流程》文章详细介绍了流媒体服务器的部署步骤,包括更新系统、安装依赖组件、编译安装Nginx和RTMP模块、配置Nginx和FFmpeg,以及测试流媒体服务器的搭建... 目录流媒体服务器部署部署安装1.更新系统2.安装依赖组件3.解压4.编译安装(添加RTMP和openssl模块

JavaWeb-WebSocket浏览器服务器双向通信方式

《JavaWeb-WebSocket浏览器服务器双向通信方式》文章介绍了WebSocket协议的工作原理和应用场景,包括与HTTP的对比,接着,详细介绍了如何在Java中使用WebSocket,包括配... 目录一、概述二、入门2.1 POM依赖2.2 编写配置类2.3 编写WebSocket服务2.4 浏

查询SQL Server数据库服务器IP地址的多种有效方法

《查询SQLServer数据库服务器IP地址的多种有效方法》作为数据库管理员或开发人员,了解如何查询SQLServer数据库服务器的IP地址是一项重要技能,本文将介绍几种简单而有效的方法,帮助你轻松... 目录使用T-SQL查询方法1:使用系统函数方法2:使用系统视图使用SQL Server Configu

nginx-rtmp-module构建流媒体直播服务器实战指南

《nginx-rtmp-module构建流媒体直播服务器实战指南》本文主要介绍了nginx-rtmp-module构建流媒体直播服务器实战指南,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有... 目录1. RTMP协议介绍与应用RTMP协议的原理RTMP协议的应用RTMP与现代流媒体技术的关系2

mysqld_multi在Linux服务器上运行多个MySQL实例

《mysqld_multi在Linux服务器上运行多个MySQL实例》在Linux系统上使用mysqld_multi来启动和管理多个MySQL实例是一种常见的做法,这种方式允许你在同一台机器上运行多个... 目录1. 安装mysql2. 配置文件示例配置文件3. 创建数据目录4. 启动和管理实例启动所有实例

VScode连接远程Linux服务器环境配置图文教程

《VScode连接远程Linux服务器环境配置图文教程》:本文主要介绍如何安装和配置VSCode,包括安装步骤、环境配置(如汉化包、远程SSH连接)、语言包安装(如C/C++插件)等,文中给出了详... 目录一、安装vscode二、环境配置1.中文汉化包2.安装remote-ssh,用于远程连接2.1安装2

Window Server创建2台服务器的故障转移群集的图文教程

《WindowServer创建2台服务器的故障转移群集的图文教程》本文主要介绍了在WindowsServer系统上创建一个包含两台成员服务器的故障转移群集,文中通过图文示例介绍的非常详细,对大家的... 目录一、 准备条件二、在ServerB安装故障转移群集三、在ServerC安装故障转移群集,操作与Ser

NFS实现多服务器文件的共享的方法步骤

《NFS实现多服务器文件的共享的方法步骤》NFS允许网络中的计算机之间共享资源,客户端可以透明地读写远端NFS服务器上的文件,本文就来介绍一下NFS实现多服务器文件的共享的方法步骤,感兴趣的可以了解一... 目录一、简介二、部署1、准备1、服务端和客户端:安装nfs-utils2、服务端:创建共享目录3、服