新建dnsmasq局域网dns服务

Administrator 8 2024-01-03

新建dnsmasq局域网dns服务

服务端配置:

1、安装局域网小型解析服务:dnsmasq

yum install dnsmasq -y
[root@dns-server ~]# dnsmasq --version
Dnsmasq version 2.76  Copyright (c) 2000-2016 Simon Kelley
Compile time options: IPv6 GNU-getopt DBus no-i18n IDN DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth nettlehash no-DNSSEC loop-detect inotify

This software comes with ABSOLUTELY NO WARRANTY.
Dnsmasq is free software, and you are welcome to redistribute it
under the terms of the GNU General Public License, version 2 or 3.

2、服务操作命令

systemctl status dnsmasq #查看状态
systemctl start dnsmasq #启动
systemctl stop dnsmasq #停止
systemctl restart dnsmasq #重启
systemctl enable dnsmasq #开机自启

3、配置文件

/etc/dnsmasq.d/resolv.dns.conf (修改后重启服务!)
server=/docker.com/8.8.8.8#53
server=/binance.com/8.8.8.8#53
server=/googleapis.cn/8.8.8.8#53
server=/godaddy.com/8.8.8.8#53
server=/tortoisesvn.net/8.8.8.8#53
server=/linkedin.com/8.8.8.8#53
server=/kameleoon.io/8.8.8.8#53
server=/gstatic.com/8.8.8.8#53
server=/bitpay.com/8.8.8.8#53
server=/okx.com/8.8.8.8#53

4、客户端修改dns地址为服务端IP即可!!