About the DNS service cannot resolve problem handling

Source: Internet
Author: User
Tags nameserver

Today, when I was playing VMware, I ping www.baidu.com with the ping command, and the results show Unkown hosts www.baidu.com, but ping a certain IP is normal.


Examples are as follows:

[[email protected] ~]# Ping www.baidu.com
Ping:unknown Host Www.baidu.com


[[email protected] ~]# Ping 119.29.25.60
PING 119.29.25.60 (119.29.25.60) bytes of data.
Bytes from 119.29.25.60:icmp_seq=1 ttl=128 time=41.9 ms
Bytes from 119.29.25.60:icmp_seq=2 ttl=128 time=43.3 ms
Bytes from 119.29.25.60:icmp_seq=3 ttl=128 time=41.7 ms
Bytes from 119.29.25.60:icmp_seq=4 ttl=128 time=41.7 ms
Bytes from 119.29.25.60:icmp_seq=5 ttl=128 time=42.5 ms


As checked, DNS is not configured properly:


See/etc/resolv.conf Discovery:

NameServer xxx.xxx.xxx.xxx


Then reconfigure the/etc/resolv.conf

NameServer 8.8.8.8 (google Domain master server)

NameServer 4.4.4.4 (google domain backup server)

Save exit after configuration is complete.

Test results:

# ping Www.baidu.com
PING www.a.shifen.com (61.135.169.125) bytes of data.
Bytes from 61.135.169.125:icmp_seq=1 ttl=128 time=20.8 ms
Bytes from 61.135.169.125:icmp_seq=2 ttl=128 time=21.0 ms
Bytes from 61.135.169.125:icmp_seq=3 ttl=128 time=20.8 ms

Use the dig command:

# Dig Www.baidu,com

; <<>> DiG 9.8.2rc1-redhat-9.8.2-0.17.rc1.el6_4.6 <<>> www.baidu,com
;; Global options: +cmd
;; Got Answer:
;; ->>header<<-opcode:query, Status:noerror, id:9710
;; Flags:qr Rd RA; Query:1, Answer:1, Authority:1, additional:0

;; QUESTION section:
; www.baidu,com. In A

;; ANSWER section:
Www.baidu,com. 5 in A 220.250.64.26

Display is normal.


However, after the server restarts, the domain name can not be resolved, after analysis found that:

In the/etc/sysconfig/network-scripts/ifcfg-eth0 file

Peerdns=no # # #DNS系统关闭状态

Therefore, the DNS system cannot resolve the domain name after each reboot.

You can change this comment to Yes and then restart the network after the modification is complete.

This article from "Not the same Sky" blog, declined reprint!

About the DNS service cannot resolve problem handling

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.