Dns Problems In debian

Source: Internet
Author: User
For dns Problems In debian, refer to Debian, the Linux release technology. For details, refer to the following section. A debian machine cannot ping the Domain Name

The error message "unknow hosts" indicates that DNS is not set.

Cat/etc/reslove. conf
Nameserver 202.106.0.20

It is strange to use the nslookup and dig commands. The two packages are not installed.

First, apt-get install dnsutils.

Then dig-t a www.baidu.com
; <> DiG 9.4.2 <>-t a www.baidu.com
; Global options: printcmd
; Got answer:
;-> HEADER <-opcode: QUERY, status: NOERROR, id: 5977
; Flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 0

; Question section:
; Www.baidu.com. IN

; Answer section:
Www.baidu.com. 1137 in cname www.a.shifen.com.
Www.a.shifen.com. 1137 in a 202.108.22.5
Www.a.shifen.com. 1137 in a 202.108.22.43

; Authority section:
A.shifen.com. 71693 in ns ns6.a.shifen.com.
A.shifen.com. 71693 in ns ns1.a.shifen.com.
A.shifen.com. 71693 in ns ns3.a.shifen.com.
A.shifen.com. 71693 in ns ns5.a.shifen.com.

; Query time: 647 msec
; SERVER: 211.99.197.19 #53 (211.99.197.19)
; WHEN: Sun Mar 30 00:35:25 2008
; Msg size rcvd: 162

It seems that DNS is normal. Why can't I ping www.baidu.com for resolution?

Exchange :~ # Ping www.baidu.com
Ping: unknown host www.baidu.com

It turns out to be the setting in/etc/nsswitch. conf.

Vi/etc/nsswitch. conf

Hosts: files

Add a dns at the end.

Hosts: files dns

Save and exit

Exchange :~ # Ping www.baidu.com
PING www.a.shifen.com (202.108.22.5) 56 (84) bytes of data.
64 bytes from xd-22-5-a8.bta.net.cn (202.108.22.5): icmp_seq = 1 ttl = 51 time = 371 MS

Now you can parse it.

Author: wind and clouds
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.