The resolv. conf file in javastuserver is overwritten when it is restarted.

Source: Internet
Author: User
/Etc/resolv. after dns is set in conf, the file will be overwritten every time tuserver is restarted. To solve this problem, find some solutions to prevent/etc/resolv. method 1 covered by conf. you need to create a file/etc/resolvconf/resolv. conf. d/tailsudovi/etc/resolvconf/resolv. conf. d/tail2. write yourself to the file

After dns is set in/etc/resolv. conf, the file will be overwritten every time the Ubuntu Server is restarted. In this case, some solutions are provided.

Methods to prevent/etc/resolv. conf from being overwritten

Method 1

1. Create a file/etc/resolvconf/resolv. conf. d/tail.

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

2. Write the desired dns server to the file in the same format as/etc/resolv. conf.

Nameserver8.8.8.8

3. Restart the resolvconf program.

Sudo/etc/init. d/resolvconf restart

Check the/etc/resolv. conf file and you can see that the dns server you added has been added to this file.

Method 2

In/etc/network/interfaces

  1. ### Interfaces #######
  2. Auto eth0
  3. Iface eth0 inetStatic
  4. Address192.168.3.250
  5. Netmask255.255.255.0# Subnet Mask
  6. Gateway192.168.3.1# Gateway
  7. Dns-nameservers8.8.8.8 8.8.4.4# Setting dns servers
Related Article

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.