zoukankan      html  css  js  c++  java
  • ubuntu下安装加装DNS

    感觉在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




  • 相关阅读:
    十一月计划
    归并排序+例题
    今年暑假不AC(简单贪心)
    路障(BFS)
    堆优化版Dijkstra模板
    十月计划
    Find a way(BFS)
    Prime Path(BFS)
    Find The Multiple
    k8s中node节点资源不足
  • 原文地址:https://www.cnblogs.com/chen-yong/p/5323934.html
Copyright © 2011-2022 走看看