Linux can ping ip cannot ping domain name detailed

Source: Internet
Author: User

Today, in the development of colleagues, the intranet can not access their own servers through the domain name! And then did the following tests to discover the problem:

[Root@itmop ~]# Ping www.downcc.com

Ping:unknown Host Www.downcc.com

[Root@itmop ~] #ping 192.168.1.1

PING 192.168.1.1 (192.168.1.1) bytes of data.

Bytes from 192.168.1.1:icmp_seq=1 ttl=64 time=0.537 ms

Bytes from 192.168.1.1:icmp_seq=2 ttl=64 time=0.430 ms

-192.168.1.1 Ping statistics-

2 packets transmitted, 2 received, 0% packet loss, time 999ms

RTT Min/avg/max/mdev = 0.430/0.483/0.537/0.057 ms

[Root@itmop ~] #cat/etc/host.conf

Order Bind,hosts

After a search after the solution, the reasons and methods are as follows:

[Root@itmop ~]# grep host/etc/nsswitch.conf

#hosts: DB Files Nisplus NIS DNS

Hosts:files

Host only find files do not go to DNS, it should be hosts:files DNS!

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.