いももちのきもち

悪戦苦闘の歴史のメモ

ssh: Could not resolve hostname github.comの解消

新しいUbuntu Desktop環境を作ったのでgithubに公開鍵を登録して、さてgit cloneでもするかと思ったらエラー。

ssh: Could not resolve hostname github.com: Temporary failure in name resolution
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
thinking_face

調べてみると似たような質問がstackoverflowに載っていた。
git - ssh: Could not resolve hostname github.com: Name or service not known; fatal: The remote end hung up unexpectedly - Stack Overflow


うちもDNSエラーかもしれない。
pingしてみると返事がない...

$ ping github.com
ping: unknown host github.com

network-manager を再起動した。

$ sudo service network-manager restart

これでgit cloneできるようになった。
apt-get update/upgradeでnetwork-managerが消される場合があるらしい?