Page 1 of 1

Signal guest to refresh nameserver info when guest via vpn

Posted: 4. May 2009, 00:17
by patelbhavesh
Every now and then I use my guest operating system to a vpn/
So obviousy my nameserver/dns information changes.
Im using NAT'ed host.
Is there an automatic way in VBox to signal the guest OS that it needs to refresh the nameserver/dns information ?
For the time being i have to manually change the resolv.conf but was hoping to see some automatic way of doing it ?
Im on vbox 2.2.0
Any ideas ?

Re: Signal guest to refresh nameserver info when guest via vpn

Posted: 4. May 2009, 01:13
by Perryg
The guest needs to refresh the dns pool not VBox.
You should be able to put something in a cron job for that though.

Re: Signal guest to refresh nameserver info when guest via vpn

Posted: 4. May 2009, 05:59
by patelbhavesh
Im not an expert on networking, but this is what i have observed.

When a vpn is created a new network interface is used on the guest os like say juniper netwroks which uses the guest OS's.
But as vbox is associated to the NIC of the guest os it does not know that a new network interface like juniper netwroks is created and all traffic is tunneled thru it.

so say for example guest os has ip address as 192.168.1.4 and dns is 67.88.88.xx and then when the vpn connection is made with say juniper network the ip address for junipers interface is 172.xx.xx.xx and the dns and nameserver is 172.134.xx.xx etc so Vbox does not come to know that a new tunnel is created and hence the host os still tries DNS with 67.88.88.xx

So im curious whether is this something Vbox needs to handle or the host os ?

Re: Signal guest to refresh nameserver info when guest via vpn

Posted: 4. May 2009, 08:24
by baf
One way is to let your host handle it.
If you are on nat you can set your resolv.conf like this:

Code: Select all

nameserver 10.0.2.3
I'm not sure if it's VirtualBox or your host that handles it but it works fine for me on Mac OSx at least.

Re: Signal guest to refresh nameserver info when guest via vpn

Posted: 4. May 2009, 14:30
by patelbhavesh
baf wrote:One way is to let your host handle it.
If you are on nat you can set your resolv.conf like this:

Code: Select all

nameserver 10.0.2.3
I'm not sure if it's VirtualBox or your host that handles it but it works fine for me on Mac OSx at least.
Thnx i will try it out resolv.conf is handled by the guest os.So im assuming that we are saying that we need to set the DNS and nameserver as the ip address of the host ?

Re: Signal guest to refresh nameserver info when guest via vpn

Posted: 4. May 2009, 16:10
by vbox4me2
When a VPN is created the new adapter should get all relevant info from the VPN server, plus the default gateway should be adjusted conform the VPN values, if this doesn't happen the VPN server is at fault here.

Re: Signal guest to refresh nameserver info when guest via vpn

Posted: 5. May 2009, 05:09
by patelbhavesh
vbox4me2 wrote:When a VPN is created the new adapter should get all relevant info from the VPN server, plus the default gateway should be adjusted conform the VPN values, if this doesn't happen the VPN server is at fault here.
The VPN adapter is created in the Host OS because thats where im connecting with VPN.All the information for the Host OS is correctly set by the VPN server and Im able to use it without any issues.
However the issue is with the Guest OS because the Guest OS continues to have the information of nameservers/dns etc before the vpn connection was made including the ip address which was obtained by the guest os from Vbox.

After the VPN is connected there does not seem to be any automatic way to signal the guest os that something in the layer below VBox , has changed that is a new adapter is being used.

Also note that only name server is a problem becuse i can ping all the machines behind the VPN with their ip address.

Anyways looks like currently the best way is to manually set the value thru a script of the nameserver/dhcp after a vpn connection is established and then restoring it to the previous value after the vpn connection is disconnected.

Re: Signal guest to refresh nameserver info when guest via vpn

Posted: 7. May 2009, 06:37
by patelbhavesh
I think i found the answer to this thread.Looks like it is a Windows issue

http://forums.virtualbox.org/viewtopic.php?f=6&t=17383