Ubuntu failure in resolv. conf restart

Source: Internet
Author: User
Tags nameserver

Ubuntu failure in resolv. conf restart

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 becauseThe resolv. conf file is actually a Link file.,

Vconf service, which is used to control the content of/etc/resolv. conf. 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

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.