linux mint 安装 dnsmasq 服务

  1. 安装
sudo apt-get -y install dnsmasq
  1. 安装成功,启动失败。端口占用的问题,停止占用的服务
sudo systemctl stop systemd-resolved.service 
sudo systemctl disable systemd-resolved.service 
  1. 重启 dnsmasq 服务
 sudo systemctl restart dnsmasq.service
  1. 配置 dnsmasq 解析
    进入 /etc/dnsmasq.d 文件夹并创建 conf resolv 两个文件夹

vim /etc/dnsmasq.conf 最后一行添加

# Include all files in /etc/dnsmasq.d except RPM backup files
conf-dir=/etc/dnsmasq.d/conf,.rpmnew,.rpmsave,.rpmorig

vim /etc/dnsmasq.d/conf/dns.conf

# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
#resolv-file=
resolv-file=/etc/dnsmasq.d/resolv/resolv.conf

# Add domains which you want to force to an IP address here.
# The example below send any host in double-click.net to a local
# web-server.
#address=/double-click.net/127.0.0.1
address=/nofeel.test/192.168.1.8
# --address (and --server) work with IPv6 addresses too.
#address=/www.thekelleys.org.uk/fe80::20d:60ff:fe36:f83

# Add the IPs of all queries to yahoo.com, google.com, and their
# subdomains to the vpn and search ipsets:
#ipset=/yahoo.com/google.com/vpn,search

/etc/dnsmasq.d/resolv/resolv.conf

nameserver 223.5.5.5
nameserver 114.114.114.114
nameserver 8.8.8.8
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值