BerlinVagrant / vagrant-dns

A plugin to manage DNS records for vagrant environments
MIT License
490 stars 50 forks source link

DNS names not visible inside box #57

Closed bertramn closed 6 years ago

bertramn commented 6 years ago

In your README file you state "Not visible inside the box", which at least for Virtualbox you can easily fix by adding the provisioning flag --natdnshostresolver1=on. So below virtualbox provisioner configuration would switch this on for you and then you can DNS resolve against RubyDNS from within this and any other box you may start with this configuration switch.

config.vm.provider "virtualbox" do |vb|
  vb.gui = false
  vb.name = "mybox"
  vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on", "--vrde", "off", "--vram", 10]
end

Checking

[vagrant@mybox ~]$ ping -c 1 mybox.vagrant.dev
PING mybox.vagrant.dev (192.168.34.188) 56(84) bytes of data.
64 bytes from 192.168.34.188: icmp_seq=1 ttl=64 time=0.015 ms

--- mybox.vagrant.dev ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.015/0.015/0.015/0.000 ms
fnordfish commented 6 years ago

Thanks, just merged an old PR putting this into the Readme.