Ubuntu failure in resolv. conf restart

Source: Internet
Author: User
Tags nameserver
In general, we can use resolv. conf in Ubuntu to set the DNS address. After restart, the address in resolv. conf will still return the original content. This is because the resolv. conf file is actually a Link file, and there is a resolvconf service in Ubuntu, which is used to control/etc/resolv. conf content. So once we restart the system or the service,/etc/resolv.

In general, we can use resolv. conf in Ubuntu to set the DNS address. After restart, the address in resolv. conf will still return the original content.

This is because the resolv. conf file is actually a Link file,

There is a resolvconf service in Ubuntu, which is used to control/etc/resolv. conf content. So once we restart the system or the service, the content in the/etc/resolv. conf file will be restored to the original content. Therefore, directly modifying/etc/resolv. conf does not solve this problem.

Solution:

1. Define the DNS address in the NIC configuration file:

Iface eth0 inet static

Address 192.168.0.10

Netmask 255.255.255.0

Gateway 192.168.0.1

Dns-nameserver 8.8.8.8 8.8.4.4

2. modify the configuration file of the resolvconf service:

Vim/etc/resolvconf/resolv. conf. d/base

Add or modify:

Nameserver 8.8.8.88.8.4.4

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-06/119021.htm

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.