简体   繁体   中英

Couldn't resolve host 'bucket.s3.amazonaws.com' on virtual machine

Serving static pdfs from S3. Have a production environment on AWS and a development environment on my local Vagrant Virtual Machine. Everything was working fine until today.

When I try to access S3 files from my Vagrant development environment, I get

Couldn't resolve host 'bucket.s3.amazonaws.com'

I can still access the files as normal in my AWS production environment. The code to access is the exact same.

Other notes that may or may not be relevant

  1. The VM was reset this morning. It has not worked since.
  2. I've tried to flush the DNS -> ipconfig /flushdns
  3. I've cleared the browser cache

Thanks for any help.

What do you mean by "the VM was reset"? I've run into problems when I forget to put the VM into suspend and then change networks on the host machine. I won't be able to resolve anything after that. To fix I just did a vagrant suspend && vagrant up to have it refresh its network.

I faced a similar issue when tried to fetch S3 files using vagrant on openstack, solved it by configuring DNS on my openstack subnet. (meaning the DNS issue wasn't related to the vagrant vm configuration, it was related to the openstack configuration, you can verify it by running: cat /etc/resolv.conf from your vagrant vm)

只是尝试在sudo前使用sudo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM