why you think that?

VM usually uses host machine DNS.

If you know the corportate DNS, you can set those in the VM using a shell
script and a vagrant provisioner


FRITZ!Box <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Fri, Nov 3, 2017 at 3:11 PM, rcpunc <catherine.hur...@gmail.com> wrote:

> I tried adding -  vb.customize ["modifyvm", :id, "--natdnshostresolver1",
> "on"]  but it had no effect.
> The vm should get its dns settings from the corporate network, but no idea
> why it doesn't
>
> On Friday, 3 November 2017 12:49:38 UTC, Alvaro Miranda Aguilera wrote:
>>
>> if you need or want to use a different dns
>>
>> you could use a provisioning script to do that.
>>
>> or check this :
>>
>> https://serverfault.com/questions/453185/vagrant-virtualbox-
>> dns-10-0-2-3-not-working
>>
>>
>>
>> On Fri, Nov 3, 2017 at 1:21 PM, rcpunc <catherin...@gmail.com> wrote:
>>
>>> Hi everyone
>>>
>>> I have a vagrant file that has:
>>>
>>> config.vm.box = "fso/xenial64-desktop"
>>>
>>> config.vm.network "forwarded_port", guest: 80, host: 19721, host_ip:
>>> "127.0.0.1"
>>>
>>> config.vm.network "public_network", bridge: "Intel(R) Ethernet
>>> Connection I217-LM"
>>>
>>> There is also config.vm.provision with multiple sudo apt-get
>>>
>>> When I do vagrant up, it fails on the first apt-get as it can't resolve:
>>> Err:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 sshpass
>>> amd64 1.05-1
>>> ==> default:   Temporary failure resolving 'us.archive.ubuntu.com'
>>>
>>> I can see in virtual box that the box is running and it has got an ip
>>> from dhcp on the corporate network but the dns settings in /etc/resolv.conf
>>> are not correct.  It has nameserver as local host and the search as the
>>> corporate domain:
>>>
>>> nameserver 127.0.1.1
>>> search corp.company.com
>>>
>>> The nics look like this:
>>> lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
>>> default qlen 1
>>>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>>>     inet 127.0.0.1/8 scope host lo
>>>        valid_lft forever preferred_lft forever
>>>     inet6 ::1/128 scope host
>>>        valid_lft forever preferred_lft forever
>>> 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
>>> state UP group default qlen 1000
>>>     link/ether 08:00:27:4a:c5:81 brd ff:ff:ff:ff:ff:ff
>>>     inet 10.0.2.15/24 brd 10.0.2.255 scope global enp0s3
>>>        valid_lft forever preferred_lft forever
>>>
>>> 3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
>>> state UP group default qlen 1000
>>>     link/ether 08:00:27:15:b4:68 brd ff:ff:ff:ff:ff:ff
>>>     inet 10.7.6.99/24 brd 10.2.7.255 scope global dynamic enp0s8
>>>        valid_lft 172754sec preferred_lft 172754sec
>>>
>>>
>>> If I  disable enp0s8 and reconnect it, it gets the correct dns in
>>> /etc/resolv.conf
>>>
>>> and then I have to run vagrant provision to get all the packages that
>>> should be provisioned
>>>
>>> Does anyone know what is wrong with the vagrant file that it is not
>>> doing this correctly when I run vagrant up?
>>>
>>>
>>> Thanks
>>>
>>> --
>>> This mailing list is governed under the HashiCorp Community Guidelines -
>>> https://www.hashicorp.com/community-guidelines.html. Behavior in
>>> violation of those guidelines may result in your removal from this mailing
>>> list.
>>>
>>> GitHub Issues: https://github.com/mitchellh/vagrant/issues
>>> IRC: #vagrant on Freenode
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Vagrant" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to vagrant-up+...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/vagrant-up/235ec2b4-b9a9-4474-a979-176a2c1e3102%40googlegroups.com
>>> <https://groups.google.com/d/msgid/vagrant-up/235ec2b4-b9a9-4474-a979-176a2c1e3102%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Alvaro
>>
>> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/vagrant-up/5a241b69-2290-4fe8-bfa0-b73e59228765%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/5a241b69-2290-4fe8-bfa0-b73e59228765%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Alvaro

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vagrant-up+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ey1x9OdW505ap-dYAk_zHXo37OdTscWL9eOYtZPPf-_sg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to