5分钟入门dnsmasq

人盡茶涼 提交于 2020-02-25 23:21:47

5分钟入门dnsmasq

Dnsmasq 提供 DNS 缓存和 DHCP 服务功能

dnsmasq install

yum install -y dnsmasq
systemctl enable dnsmasq

dnsmasq config

# vi /etc/dnsmasq.conf

listen-address=192.168.1.132,127.0.0.1

## 转发域名解析
server=/cn/114.114.114.114
server=/taobao.com/114.114.114.114

## 指定域名解析
address=/ad.iqiyi.com/127.0.0.1
address=/ad.iqiyi.com/127.0.0.1

## DHCP设定
dhcp-range=192.168.1.50,192.168.1.150,48h

dhcp-host=00:0C:29:5E:F2:6F,192.168.1.201,os02
dhcp-host=00:0C:29:15:63:CF,192.168.1.202,os03

local=/ic.lo/
domain=ic.lo

dhcp-option=3,192.168.0.1

# restart service
systemctl restart dnsmasq

dnsmasq check

dig www.baidu.com
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!