一、安装DNS服务器
1.1 配置DNS配置文件dnsmasq.conf
#dnsmasq config, for a complete example, see: # http://oss.segetech.com/intra/srv/dnsmasq.conf #log all dns queries log-queries #dont use hosts nameservers no-resolv #use cloudflare as default nameservers, prefer 1^4 server=1.0.0.1 server=1.1.1.1 strict-order #serve all .company queries using a specific nameserver server=/company/10.0.0.1 #explicitly define host-ip mappings address=/myhost.company/10.0.0.2
1.2 安装(注意:dns服务器默认端口53)
docker run --name dnsmasq_server -d -p 53:53/udp -p 5380:8080 -v "$PWD"/dnsmasq.conf:/etc/dnsmasq.conf --log-opt "max-size=100m" -e "HTTP_USER=okvoice" -e "HTTP_PASS=okvoice" --restart always jpillora/dnsmasq
二、配置本机dns
2.1 mac配置
2.2 windows配置
2.3 liunx配置
service network restart