局域网内配置私有的下游dns

常见的dns开源软件有很多,bind,dnsmasq,smartdns等等,本文主要介绍比较容易上手的smartdns。

安装

环境是centos7
从github下载smartdns
https://github.com/pymumu/smartdns/releases

image.png

下载后上传到服务器,然后执行如下命令

 tar zxf smartdns.1.yyyy.MM.dd-REL.x86_64-linux-all.tar.gz
 cd smartdns
 chmod +x ./install
 ./install -i

配置

  1. 配置上游服务器
    默认配置文件 /etc/smartdns/smartdns.conf
    在smartdns.conf文件中配置上游服务器

上游dns

server 182.16.188.13
server 8.8.8.8

配置想要的域名

自定义域名

address /xxx.xxx.com/182.18.4.112
上述配置含义:xxx.xxx.com 映射到182.18.4.112
每条映射一行
每次增加域名后需要重启服务,所以该软件只适用于局域网内部开发测试使用。

启动命令

systemctl enable smartdns
systemctl start smartdns
systemctl restart smartdns
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容