首页 > 系统服务 > 详细

ubuntu下安装加装DNS

时间:2016-03-26 22:00:05      阅读:192      评论:0      收藏:0      [点我收藏+]

感觉在ubuntu下网速特别的慢,所以网上找了下解决方案,本地缓存域名解析相关信息。

首先,安装dns服务


命令: sudo apt-get install dnsmasq

编辑dnsmasq的配置文件

命令: sudo gedit /etc/dnsmasq.conf

找到下面这一项

#resolv-file=

用下面的一条语句替换

resolv-file=/etc/resolv.dnsmasq.conf

确保你没有更改过/etc/resolv.conf文件,如果改过,恢复原状

然后执行命令

sudo cp /etc/resolv.conf /etc/resolv.dnsmasq.conf

然后编辑resolv.conf

命令;sudo vi /etc/resolv.conf

将其中的域名服务器全部去掉,加入以下这行

nameserver 127.0.0.1

保存,退出

执行以下命令
sudo vi /etc/ppp/peers/provider
在 usepeerdns 前面增加 # ,也就是把这条注释

以防,resolv.conf的设置被pppoe覆盖。
设置网络DNS服务器:系统设置---网络连接管理----IPv4----dns服务器设置
然后重启dns服务:/etc/init.d/dnsmasq restart




ubuntu下安装加装DNS

原文:http://www.cnblogs.com/chen-yong/p/5323934.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!