Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
718 views
in Technique[技术] by (71.8m points)

networking - Could not resolve hostname, ping works

I have installed RasPi Raspbian, and now I can't do ssh or git clone, only local host names are being resolved it seems. And yet ping works:

pi ~ $ ssh test.com
ssh: Could not resolve hostname test.com: Name or service not known

pi ~ $ git clone [email protected]:test.git
Cloning into 'test'...
ssh: Could not resolve hostname test.com: Name or service not known
fatal: The remote end hung up unexpectedly

pi ~ $ ping test.com
PING test.com (174.36.85.72) 56(84) bytes of data.

I sort of worked around it for github by using http://github.com instead of git://github.com, but this is not normal and I would like to pinpoint the problem.

Googling for similar issues but the solutions offered was either typo correction, or adding domains to hosts file.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This sounds like a DNS issue. Try switching to another DNS server and see if it works.

OpenDNS

  • 208.67.222.222
  • 208.67.220.220

GoogleDNS

  • 8.8.8.8
  • 8.8.4.4

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...