44
27

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

curlで「Couldn't resolve host」エラーが出た場合の対処

Last updated at Posted at 2017-04-15

仮想環境(Vagrant)で、curlを試したところ下記のエラーが出ました。

[root@vagrant-centos65]# curl http://www.yahoo.co.jp
curl: (6) Couldn't resolve host 'www.yahoo.co.jp'

/etc/resolv.confのDNS設定がおかしい為に取得失敗していたようです。

/etc/resolv.conf
nameserver 8.8.8.8

上記のように修正し、apacheを再起動しcurlを再実行すると
うまくいきました。

44
27
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
44
27

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?