I am unable to connect to the internet from within a Vagrant virtual machine I have set up.
For example, at the root, when I type:
curl http://google.com
This looks like a DNS configuration issue. Do a nslookup google.com
and see what the result is.
Try to add the following block in your Vagrantfile
, set --natdnshostresolver1
to on so as to force the VirtualBox NAT engine to intercept DNS requests and forward them to host's resolver
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
BTW: Without vagrant reload
, you can directly look into the /etc/resolv.conf
inside the VM, can manually set it to the DNS server of your network, most likely it'll work fine.