Linux DNS Settings failed

Source: Internet
Author: User
Tags dns2 nameserver

Failed to find download when executing yum install GCC

Ping www.baidu.com

Ping does not pass

Ping Baidu's ip:220.181.111.188 but can ping through

This proves to be a problem with DNS

Baidu after check to set the DNS need to run the command: vi/etc/resolv.conf

Add to:

NameServer 192.168.0.1

NameServer 192.168.0.1

However, after running the vi/etc/resolv.conf prompt:

# Generated by NetworkManager
Search an


# No nameservers found; Try putting DNS servers into your
# ifcfg files in/etc/sysconfig/network-scripts like so:
#
# dns1=xxx.xxx.xxx.xxx
# dns2=xxx.xxx.xxx.xxx
# domain=lab.foo.com Bar.foo.com


So run Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Add to

# dns1=192.168.0.1
# dns2=192.168.0.1
# domain=lab.foo.com Bar.foo.com

Running Service Network restart

Find out or ping not pass

Run vi/etc/resolv.conf Discovery added nameserver missing

Find a solution after a network search:

1. #Remove Network Manager from startup service

Chkconfig Networkmanagermangager off

2. #Add Default Net Manager

Chconfig Network on

3. Stop NetworkManager First

Service NetworkManager Stop

4. #and then start Default Manager

Service Network start

5. #restart Network

Service Network restart

Reconfigure the DNS configuration file to restart the network

Ping www.baidu.com

Success

This article refer to Http://wenku.baidu.com/link?url= Hdebl7k6lihjid-zqwmihw5mkswm4d7ls8p-yrhb7igbpkylrmxnvo5sfxgds7bgwrn9v2ix5a5c9nbgmqq0dtjpsh1cib47_vqzxrduhcw

Linux DNS Settings failed

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.