Linux: Server ping domain name (can ping IP address)

Source: Internet
Author: User
Tags domain name server nameserver


There are three steps you can take to find a solution if you are sure that your network is not a problem:


1) Determine the domain name server is set, if not, you can set up Google's public DNS services;


# cat/etc/resolv.conf

-------------------------------------------------------------------

NameServer 8.8.8.8

NameServer 8.8.4.4

-------------------------------------------------------------------

# vi/etc/resolv.conf (can be changed into)

Note: If the server itself is set to this domain name, then you can try a different DNS service;

For example:

A, Beijing unicom broadband DNS address 202.106.196.115:202.106.46.151:202.106.0.20,ping address that address is fast. You use that DNS address.

B, the first domestic, the world's third open DNS service address, also known as 114DNS (114.114.114.114)

Usually encounter a phenomenon: can QQ but web page open mostly is the problem of DNS

In this case, you only need to change the preferred DNS to 114.114.114.114 or 8.8.8.8 Basic Workaround

c, DNS services There are many, if it is the room, you can ask the room staff recommend the use of which;


2) Make sure the gateway is set


# grep gateway/etc/sysconfig/network-scripts/ifcfg*

-------------------------------------------------------------------

/etc/sysconfig/network-scripts/ifcfg-eth0:gateway=192.168.40.1

-------------------------------------------------------------------

Ps:ubuntu 10.3 Cannot find this file, maybe the version is wrong


3) ensure available DNS resolution


# grep hosts/etc/nsswitch.conf

-------------------------------------------------------------------

Hosts:files DNS

-------------------------------------------------------------------


If any of the above problems, after the correction, re-test, should be no problem:

Linux: Server ping domain name (can ping IP address)

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.