說明:目前已經部署好內網DNS服務器,能夠直接使用前端
10.100.2.230
須要加自定義域名指向,請在10.100.2.230
(前端測試服務器)上添加規則vim
> vim /etc/dnsmasq.d/address.conf
上游DNS沒法解析,設置上游DNS服務器
> vim /etc/resolv.dnsmasq.conf
設置完成,重啓dnsmasq生效網絡
> systemctl restart dnsmasq
> brew install dnsmasq
將以下配置追加到/usr/local/etc/dnsmasq.conf
測試
resolv-file=/usr/local/etc/resolv.dnsmasq.conf strict-order no-hosts cache-size=32768 listen-address=127.0.0.1,Your IP # 後面加上你本身內網的IP
將上游DNS配置追加到/usr/local/etc/resolv.dnsmasq.conf
調試
nameserver 8.8.8.8 nameserver 8.8.4.4 nameserver 42.120.21.30 nameserver 168.95.1.1
將須要解析的域名規則追加到/usr/local/etc/dnsmasq.conf
rest
address=/mock.yyfe.com/10.100.2.230 address=/mock2.yyfe.com/10.100.2.230
啓動dnsmasq(須要root權限)code
sudo brew services start dnsmasq
> yum install -y dnsmasq
將以下配置追加到/etc/dnsmasq.conf
server
resolv-file=/usr/local/etc/resolv.dnsmasq.conf strict-order no-hosts cache-size=32768 listen-address=127.0.0.1,Your IP # 後面加上你本身內網的IP
將上游DNS配置追加到/etc/resolv.dnsmasq.conf
dns
nameserver 10.100.2.16 # 公司內網上游DNS nameserver 8.8.8.8 nameserver 8.8.4.4 nameserver 42.120.21.30 nameserver 168.95.1.1
將須要解析的域名規則追加到/etc/dnsmasq.d/address.conf
address=/mock.yyfe.com/10.100.2.230 address=/mock2.yyfe.com/10.100.2.230
啓動dnsmasq
systemctl start dnsmasq