Page 1 of 1
Using host's "hosts" file from within guest
Posted: 11. Oct 2012, 10:26
by Twisted Lucidity
Host: Win 7 64-bit
Guest: Win 2003 Server 64-bit (NAT)
Guest was migrated from VMWare, not sure if that has any bearing.
My host connects to a corporate VPN and I have various servers recorded in the host's "hosts" file. This allows name resolution to work correctly from the host.
The guest is using NAT, but it cannot resolve these names. Is there anyway to have the name resolution be handled by the host? This would save me having to keep two files in sync.
This guest was migrated from VMWare (where such host-driven name resolution worked), not sure if that has any bearing.
VPN is Cisco, not sure if I am hitting the GRE limitation on NAT but the VPN client states the transport is "IPSec/UDP".
Re: Using host's "hosts" file from within guest
Posted: 11. Oct 2012, 12:49
by mpack
Why not just copy the hosts file into the guest?
Re: Using host's "hosts" file from within guest
Posted: 11. Oct 2012, 15:05
by Twisted Lucidity
Well, yes. I could do that, but any changes on the the host would have to be made in all the guests.
If the VBox NAT were (somehow) able to use the host's "hosts" like VMWare, then I wouldn't have to keep all the files in step.
But if I've hit a limitation, then I've hit a limitation.
Re: Using host's "hosts" file from within guest
Posted: 11. Oct 2012, 18:03
by mpack
I'm not a networking expert, but AFAIK the hosts file essentially says - if it's listed in the hosts file then don't bother looking up the name, just use this IP instead.
Since the intent is specifically: don't look it up, don't interact with a DNS, I don't understand how the hosts info could be shared between PCs on a network. Unless you scripted some kind of network push of course.
Re: Using host's "hosts" file from within guest
Posted: 11. Oct 2012, 18:19
by Twisted Lucidity
AIUI when using NAT it is the host effectively doing all the networking; so I would have thought the entries in the host's "hosts" file would have had an effect on the guest.
If I have this is the host's "hosts" file
and then I do
from within the guest, I would expect to see responses from 192.168.0.1. At the moment I just get "host 'foo' unknown".
Like I said, "host's 'hosts' file does guest name resolution" behaviour was what I saw when trying VMWare; so I was a bit puzzled when I didn't see it under VBox.
Re: Using host's "hosts" file from within guest
Posted: 11. Oct 2012, 18:39
by mpack
Twisted Lucidity wrote:AIUI when using NAT it is the host effectively doing all the networking
That isn't my understanding. My understanding that that the guest still implements a full network stack, however when message packets are transmitted the NIC simulation replaces the "from" address with the host address, and sets a flag. On receipt if that flag is set then it changes the "to" address and redirects the packet to the guest, and resets the flag. As far as the guest is concerned it is doing everything it should as an independant PC. In particular DNS name lookup (or not) as part of the larger transaction.
Re: Using host's "hosts" file from within guest
Posted: 11. Oct 2012, 19:30
by Twisted Lucidity
Ok then. VMWare must be doing something totally different because in NAT the host's "hosts" file does affect the guest.
Re: Using host's "hosts" file from within guest
Posted: 11. Oct 2012, 20:54
by mpack
Perhaps they implement some kind of DNS proxy?
Re: Using host's "hosts" file from within guest
Posted: 12. Oct 2012, 10:06
by Twisted Lucidity
Dunno to be honest - I thought it was a feature of using NAT; but it could be their add-ons doing something extra.
Now I know what I'm dealing with, I'll figure out a way to use a common hosts file for all guests.
Wouldn't have this problem on other operating systems...mumble...grumble...