Vagrant file - public network not getting dns

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Vagrant file - public network not getting dns

rcpunc
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/235ec2b4-b9a9-4474-a979-176a2c1e3102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vagrant file - public network not getting dns

Alvaro Miranda Aguilera
if you need or want to use a different dns

you could use a provisioning script to do that.

or check this :




On Fri, Nov 3, 2017 at 1:21 PM, rcpunc <[hidden email]> 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

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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/235ec2b4-b9a9-4474-a979-176a2c1e3102%40googlegroups.com.
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezJ8MPyhnsEfdomoXa0HzPxtyMA_6fZa-bTRz%3DMs%3Dho7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vagrant file - public network not getting dns

rcpunc
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 :

<a href="https://serverfault.com/questions/453185/vagrant-virtualbox-dns-10-0-2-3-not-working" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fserverfault.com%2Fquestions%2F453185%2Fvagrant-virtualbox-dns-10-0-2-3-not-working\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE6vZL1NFklVAVjcuI8U77L82R2TQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fserverfault.com%2Fquestions%2F453185%2Fvagrant-virtualbox-dns-10-0-2-3-not-working\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE6vZL1NFklVAVjcuI8U77L82R2TQ&#39;;return true;">https://serverfault.com/questions/453185/vagrant-virtualbox-dns-10-0-2-3-not-working



On Fri, Nov 3, 2017 at 1:21 PM, rcpunc <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="jRvUQMO-BwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">catherin...@...> 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 <a href="http://us.archive.ubuntu.com/ubuntu" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fus.archive.ubuntu.com%2Fubuntu\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFXvw76XMU3tfM8vnmsSdiAR7YnXw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fus.archive.ubuntu.com%2Fubuntu\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFXvw76XMU3tfM8vnmsSdiAR7YnXw&#39;;return true;">http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 sshpass amd64 1.05-1
==> default:   Temporary failure resolving '<a href="http://us.archive.ubuntu.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fus.archive.ubuntu.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEE_VXm5UEckDli-IJNKzDNAFJdFA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fus.archive.ubuntu.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEE_VXm5UEckDli-IJNKzDNAFJdFA&#39;;return true;">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 <a href="http://corp.company.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcorp.company.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHbxu9thQYlqpBZrtjM5JpRyH_jfA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcorp.company.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHbxu9thQYlqpBZrtjM5JpRyH_jfA&#39;;return true;">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 <a href="http://127.0.0.1/8" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F127.0.0.1%2F8\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEYFRp9CDygOXtBXqnBoiSY5kxaXg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F127.0.0.1%2F8\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEYFRp9CDygOXtBXqnBoiSY5kxaXg&#39;;return true;">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 <a href="http://10.0.2.15/24" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F10.0.2.15%2F24\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJvDMxt_Dq4EMpW71TeSFdel6FYA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F10.0.2.15%2F24\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHJvDMxt_Dq4EMpW71TeSFdel6FYA&#39;;return true;">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 - <a href="https://www.hashicorp.com/community-guidelines.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="jRvUQMO-BwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/235ec2b4-b9a9-4474-a979-176a2c1e3102%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/235ec2b4-b9a9-4474-a979-176a2c1e3102%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/235ec2b4-b9a9-4474-a979-176a2c1e3102%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/235ec2b4-b9a9-4474-a979-176a2c1e3102%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/5a241b69-2290-4fe8-bfa0-b73e59228765%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vagrant file - public network not getting dns

Alvaro Miranda Aguilera
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

On Fri, Nov 3, 2017 at 3:11 PM, rcpunc <[hidden email]> 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 :




On Fri, Nov 3, 2017 at 1:21 PM, rcpunc <[hidden email]> 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

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/msgid/vagrant-up/235ec2b4-b9a9-4474-a979-176a2c1e3102%40googlegroups.com.
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/5a241b69-2290-4fe8-bfa0-b73e59228765%40googlegroups.com.
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 [hidden email].
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.