Skip to content

Instantly share code, notes, and snippets.

@mitchellh
Created October 11, 2011 01:30
Show Gist options
  • Star 43 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save mitchellh/1277049 to your computer and use it in GitHub Desktop.
Save mitchellh/1277049 to your computer and use it in GitHub Desktop.
Configure Vagrant VM to use Host DNS for VPN
Vagrant::Config.run do |config|
# ...
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
@danmayer
Copy link

danmayer commented Feb 5, 2014

This fixes DNS lookup but host is still unreachable from within the VM, anyone have a tip for that?

@AnalogJ
Copy link

AnalogJ commented Jul 7, 2014

Does this fix work for Vagrant + VMWare + VPN's as well?

@mattgray
Copy link

Hi, I had the same problem trying to configure host DNS resolver so that I can resolve addresses from a private DNS server over a VPN, except using Test Kitchen instead of plain Vagrant. This gist configures the the test kitchen vagrant driver in the same way as above gist, except in the .kitchen.yaml syntax : https://gist.github.com/mattgray/0a72e8d61a5ca115c406

@rafaelrp
Copy link

Worked in homestead/vagrant 1.6.3 with Ubuntu 14.10

=]

@ducminhvu
Copy link

work like a charm thanks

@GTP95
Copy link

GTP95 commented Jul 2, 2021

Unfortunately, this seems to not be working anymore, got the following error while trying to destroy my previous VM:
`There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:

  • The following settings shouldn't exist: customize
    `

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment