Disable Automatic Modification of Ubuntu DNS

Source: Internet
Author: User
I restarted Ubuntu and found some webpages were inaccessible again. It showed that the desktop had been connected to the network for a long time, due to the previous problems caused by the inability to access many websites due to the DNS automatically assigned by China Telecom, I checked the DNS and found that my DNS settings were automatically modified, google found that you can use the following method to disable automatic DNS modification and retain the system's dns configuration (/etc/resolv. conf), enter sudogedit/etc/ppp/peers/dsl-provid on the terminal and restart Ubuntu, the indication is that it takes a long time to connect to the network on the desktop, because the DNS automatically assigned by China Telecom has caused the inability to access many websites, so I checked the DNS, if you find that your DNS settings have been automatically modified, google will find that you can use the following method to disable automatic DNS modification and retain the system's dns configuration (/etc/resolv. conf), terminal type:

Sudo gedit/etc/ppp/peers/dsl-provider

Find the userpeerdns line and comment out the line to disable the use of the dns automatically configured by China Telecom. Retain the dns using resolv. conf. The file is located in/etc/resolv. conf.

The dsl-provider content is as follows:
# Minimalistic default options file for DSL/PPPoE connections

Noipdefault
Defaultroute
Replacedefaultroute
Hide-password
# Lcp-echo-interval 30
# Lcp-echo-failure 4
Noauth
Persist
# Mtu 1492
# Persist
# Maxfail 0
# Holdoff 20
Plugin rp-pppoe.so eth0
# Usepeerdns
User

Ps: resolv. conf

/Etc/resolv. conf
This file is a DNS domain name resolution configuration file. Its format is very simple. Each line starts with a keyword, followed by configuration parameters. Resolv. conf has four keywords:

Nameserver
# Define the IP address domain of the DNS server
# Define the local domain name search
# Define a domain name search list sortlist
# Sort the returned domain names

An example of/etc/resolv. conf:

Domain linuxidc.com search www.linuxidc.com Linuxidc.comNameserver 202.96.128.86nameserver 202.96.128.166

The most important is the nameserver keyword. If nameserver is not specified, the DNS server cannot be found. Other keywords are optional.
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.