Ubuntu 12.04 Reset Empty/etc/resolv.conf nameserver settings how to solve

Source: Internet
Author: User
Tags empty reset nameserver

The company's new server is using the latest Ubuntu 12.04, colleagues and I reflect a problem, after each reboot,/etc/resolv.conf inside the set nameserver was emptied, very strange

root@ttpod:~# cat/etc/resolv.conf  
# Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8) 
  
   # do don't     EDIT this FILE by HAND-YOUR CHANGES'll be overwritten 
root@ttpod:~#
  

Take a closer look and find the problem

Don't EDIT this FILE by HAND-YOUR CHANGES would be overwritten

Do not edit this file manually, the changes you make will be overwritten.

Do not know is this translation, I am relatively rotten e-wen, understand this meaning.

We change DNS generally is here to change, I used Redhat.

In order to prevent the system reboot, the DNS settings are emptied, we want to change the configuration file of the NIC

root@ttpod:~# cat/etc/network/interfaces  
# This file describes the network interfaces available on your system 
# And how to activate them. For more information, interfaces (5). 
     
# The Loopback network interface
Auto lo 
iface lo inet Loopback 
     
# The Primary network interface
Auto eth0< C8/>iface eth0 inet Static address
192.168.0.2
netmask 255.255.255.0
Gateway 192.168.0.1
Dns-nameservers 192.168.0.1

Add Dns-nameservers dns_address to the inside.

Reboot again, and it won't be emptied.

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.