首頁 > 軟體

Ubuntu修改DNS重新啟動丟失問題

2020-06-16 17:48:03

Ubuntu 15.04直接修改/etc/resolv.conf,新增DNS重新啟動後設定丟失。

正確方法:

  1. #vim /etc/network/interfaces,檔案最後新增“dns-nameservers  223.5.5.5”

    重新啟動systemctl restart networking.service,測試OK

  2. #vim /etc/resolvconf/resolv.conf.d/base(檔案預設為空)

    nameserver  223.5.5.5

    nameserver  223.6.6.6

    #resolvconf -u  (更新改動至resolv.conf)

    #more /etc/resolv.conf

    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

    nameserver 223.5.5.5

    nameserver 223.6.6.6

    不需要重新啟動網絡卡/系統,測試OK,重新啟動系統後OK。


IT145.com E-mail:sddin#qq.com