linux系统如何设置私有DNS

装置dnsmasq
  brew up
 brew install dnsmasq  

# 使?用dnsmasq的默许装备.
cp $(brew list dnsmasq | grep /dnsmasq.conf.example$) /usr/local/etc/dnsmasq.conf
# 将dnsmasq设置为?自后台形式.
sudo cp $(brew list dnsmasq | grep /homebrew.mxcl.dnsmasq.plist$) /Library/LaunchDaemons/ # 将dnsmasq设置为?自动重启形式.
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

设置dnsmasq域名映射
下?面的装备会把.dev结束的域名统?一访问到dnsmasq

修正 /usr/local/etc/dnsmasq.conf 加?入 address=/dev/127.0.0.1 到第?一?行 sudo mkdir -p /etc/resolver

 sudo tee /etc/resolver/dev >/dev/null <<eof nameserver="" 127.0.0.1="" eof="" <="" span=""> 

重启dnsmasq
请留意,装备?文件 /usr/local/etc/dnsmasq.conf ?一旦修正则需求重启dnsmasq

 sudo launchctl stop homebrew.mxcl.dnsmasq
 sudo launchctl start homebrew.mxcl.dnsmasq  

测验


ping gogap.dev

留意:还要修正osx中装备—》网络—》高档—》DNS—》DNS服务器—》本机的ip地址(ifconfig)







http://kidgp.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kibla.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kidgp.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kibla.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kidgp.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kibla.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kidgp.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kibla.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kidgp.cn/ http://kibla.cn/ http://lacmu.cn/ http://kidgp.cn/ http://kibla.cn/ http://kibla.cn/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值