Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.

Vagrantfile: do not use dns 8.8.8.8 if unreachable #345

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ Vagrant.configure('2') do |config|
#we no longer build current boxes for vmware_workstation
#ensure that this fails. otherwise the user gets an old box
end

# Remove 8.8.8.8 from /etc/resolv.conf if not reachable
config.vm.provision :shell do |dns|
dns.inline = 'nslookup -retry=2 -timeout=3 www.google.com 8.8.8.8 > /dev/null || sudo sed -i "s/^\(nameserver 8.8.8.8\)$/#\1/" /etc/resolv.conf /etc/resolvconf/resolv.conf.d/head'
end
end