WSL Debianでgitコマンド実行すると「Could not resolve hostname github.com: Temporary failure in name resolution」となる件
WSL2 Debianを使って開発を行っているが、git pullを実行した所「Could not resolve hostname github.com: Temporary failure in name resolution」が返されてしまった。
色々と試したが結果的に以下対応で解決。
/etc/resolv.confのnameserverをgoogle提供のnameserverに書き換える。
まずはファイルを調べる
ls -al /etc/resolv.conf
⇒/etc/resolv.conf -> /mnt/wsl/resolv.conf
と表示されたので、リンクファイルではなく、実態ファイルコピー
cp /mnt/wsl/resolv.conf /mnt/wsl/resolv.conf.org
コピー後ファイル修正
vi /mnt/wsl/resolv.conf
もともと記述されていたnameserverはコメントアウトし、新たに「nameserver 8.8.8.8」を追加
#nameserver xxx.xxx.xxx.xxx
nameserver 8.8.8.8
保存して終了。
これでアクセス出来るようになったはず!

ディスカッション
コメント一覧
まだ、コメントがありません