在服务器上配置私有地址池.
- 安装:
- 配置文件:
- 重启dnsmasq:
Debain系列:
1 |
apt-get install -y dnsmasq |
RedHat系列:
1 |
yum install -y dnsmasq |
注意:须将eth0,改为服务器公网网卡名称.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
cat >/etc/dnsmasq.conf<<EOF except-interface=eth0 dhcp-range=192.168.8.2,192.168.8.254,255.255.255.0,24h dhcp-option-force=option:router,192.168.8.1 dhcp-option-force=option:dns-server,192.168.8.1 dhcp-option-force=option:netbios-ns,192.168.8.1 listen-address=127.0.0.1,192.168.8.1 no-resolv bogus-priv no-negcache clear-on-reload cache-size=81920 server=208.67.220.220#5353 EOF |
1 |
bash /etc/init.d/dnsmasq restart |
大佬,vps玩dnsmasq有什么用啊,我只知道openwrt可以用