/etc/resolv.conf File modification lost solution in Ubuntu

Source: Internet
Author: User

Method One

1. Need to create a file/etc/resolvconf/resolv.conf.d/tail

sudo vi/etc/resolvconf/resolv.conf.d/tail

2. Write the DNS server you need in the file in the same format as/etc/resolv.conf

NameServer 8.8. 8.8

3. Restart the RESOLVCONF program

sudo/etc/init.d/resolvconf restart

Then look at the/etc/resolv.conf file and you can see that the DNS server you added is already in the file

Method Two

In the/etc/network/interfaces

  1. # # #interfaces中 #######
  2. Auto Eth0
  3. Iface eth0 inet static
  4. Address 192.168. 3.250
  5. Netmask 255.255. 255.0 #子网掩码
  6. Gateway 192.168. 3.1 #网关
  7. Dns-nameservers 8.8. 8.8 8.8. 4.4 #设置dns服务器

/etc/resolv.conf file modification in Ubuntu missing solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.