Configure static DNS under UbuntuLinux

Source: Internet
Author: User
Article Title: Configure static DNS under UbuntuLinux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

This article briefly describes how to set up static DNS on Ubuntu.

In XP, I had a long time ago when I was very upset with the DNS hijacking of China Telecom. I always transferred Google.com to Google.cn, and got the wrong domain name and gave it a fucking "114 search". Telecom's entire super hooligans. So in XP, all DNS settings are set as OpenDNS
Server, worry-free. It is also very easy to set in Ubutu.

You can also set it in Ubuntu, such as "Main Menu", "system", "system management", and "network". In "DNS", delete the original two IP addresses and fill in the OpenDNS server, however, it will be restored after the restart, and it will be reset again after the next boot.

How does one make the DNS no longer change after each restart? The method is as follows:

First backup:
Sudo cp/etc/resolv. conf/etc/resolv. conf. bak

Edit
Sudo gvim/etc/dhcp3/dhclient. conf

Add the following lines to the end, which is the two servers of OpenDNS:
Prepend domain-name-servers 208.67.222.222, 208.67.220.220;

Edit the file "/etc/ppp/peers/dsl-provide" to complete the backup:
Sudo cp/etc/ppp/peers/dsl-provide/etc/ppp/peers/dsl-provide.bak
Sudo gvim/etc/ppp/peers/dsl-provide

Then comment out usepeerdns
This line, and finally restart. After restarting, right-click the Network icon in the notification area and click "view information" to find that DNS is still the one in China Telecom. However, when "www.google.com" is opened, it is no longer transferred to "www.google.cn"
Intentionally enter an incorrect domain name, open the OpenDNS Error Correction page, and the static DNS settings are successful.

 

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.