Customize DNS server settings in Ubuntu 12.04

Source: Internet
Author: User

From: http://blog.csdn.net/michaelyue526/article/details/8023949

With the release of ubuntu 12.04 LTS, I naturally want to experience the latest Ubuntu 12.04 server version. After habitual installation and configuration, start to configure static IP settings. No problem with other configurations, but an error occurred while configuring the DNS server.

As we all know, to modify the DNS server of the Linux system, you only need to edit the/etc/resolv. conf file. However, in Ubuntu 12.04, after opening this file, you can see the configuration information, but you can also see the two lines of comment in the file header:

#Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

This file is dynamically generated by the resolvconf program. Do not modify it manually. The modified information will be overwritten. What exactly is this?

First of all, it will not take effect. After adding your own DNS server address to it, save and quit, and find that it will take effect. It seems that there is no problem.

However, after the restart, the information I added was gone! It is automatically overwritten by the system.

However, I really need to configure the DNS server myself. In Ubuntu Desktop, You can manually configure the server using graphical interfaces. However, for Ubuntu server, there is no graphical tool. You must modify the file and configure it yourself. This file will be overwritten every time it is started, how can I save my own DNS server information to the system?

I searched the internet and found a solution. I only needed to write a new configuration file to the directory of the resolvconf program. Let's take a look at how to configure your own DNS server in Ubuntu 12.04 lts server!

First, we need to create a file/etc/resolvconf/resolv. conf. d/tail:

# Vim/etc/resolvconf/resolv. conf. d/tail

Then, we will write the DNS server we want to add in this file. The format is consistent with the previous/etc/resolv. conf file:

Nameserver 8.8.8.8
Nameserver 8.8.4.4

Enter WQ to save and exit. Next, restart the resolvconf program to make the configuration take effect:

#/Etc/init. d/resolvconf restart

Go to the/etc/resolv. conf file and write the self-added DNS server! This is a perfect solution!

View DNS settings

CAT/etc/resolv. conf check DNS server settings

Reference: http://askubuntu.com/questions/130452/how-do-i-add-a-dns-server-via-resolv-conf-ubuntu-12-04

With the release of ubuntu 12.04 LTS, I naturally want to experience the latest Ubuntu 12.04 server version. After habitual installation and configuration, start to configure static IP settings. No problem with other configurations, but an error occurred while configuring the DNS server.

As we all know, to modify the DNS server of the Linux system, you only need to edit the/etc/resolv. conf file. However, in Ubuntu 12.04, after opening this file, you can see the configuration information, but you can also see the two lines of comment in the file header:

#Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

This file is dynamically generated by the resolvconf program. Do not modify it manually. The modified information will be overwritten. What exactly is this?

First of all, it will not take effect. After adding your own DNS server address to it, save and quit, and find that it will take effect. It seems that there is no problem.

However, after the restart, the information I added was gone! It is automatically overwritten by the system.

However, I really need to configure the DNS server myself. In Ubuntu Desktop, You can manually configure the server using graphical interfaces. However, for Ubuntu server, there is no graphical tool. You must modify the file and configure it yourself. This file will be overwritten every time it is started, how can I save my own DNS server information to the system?

I searched the internet and found a solution. I only needed to write a new configuration file to the directory of the resolvconf program. Let's take a look at how to configure your own DNS server in Ubuntu 12.04 lts server!

First, we need to create a file/etc/resolvconf/resolv. conf. d/tail:

# Vim/etc/resolvconf/resolv. conf. d/tail

Then, we will write the DNS server we want to add in this file. The format is consistent with the previous/etc/resolv. conf file:

Nameserver 8.8.8.8
Nameserver 8.8.4.4

Enter WQ to save and exit. Next, restart the resolvconf program to make the configuration take effect:

#/Etc/init. d/resolvconf restart

Go to the/etc/resolv. conf file and write the self-added DNS server! This is a perfect solution!

View DNS settings

CAT/etc/resolv. conf check DNS server settings

Reference: http://askubuntu.com/questions/130452/how-do-i-add-a-dns-server-via-resolv-conf-ubuntu-12-04

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.