Page 1 of 1

Guest OS not always resolving Internet hostnames.

Posted: 11. Oct 2015, 21:02
by Benny_Boy
Config

Host

- Win7, connected to a corporate network with internal DNS and DHCP servers
- Host IP 40.70.10.2

Guest

- Ubuntu 14.04 'Trusty'
- Guest IP 10.0.2.15 (Provided by VBox DHCP)
- /etc/resolv.conf contains "nameserver 10.0.2.3"
- apt-get is manually configured to talk to the internet via a proxy server on the corporate network. This is necessary because the network domain the host machine resides on is not configured to allow access to the internet as part of the win7 logon scripts. In Win7 I have to set the same proxy settings in IE->Tools->Internet Connection if I want to browse the web on that box.

VirtualBox 5.0.6 (also tried 5.0.4)

- VirtualBox is configured to use the Host DNS settings when dealing with name requests from the Guest. This was achieved by running:

- VBoxManage modifyvm "VM name" --natdnsproxy1 off
- VBoxManage modifyvm "VM name" --natdnshostresolver1 on

- The VM is running in NAT mode with port forwarding for ports 80, 81, 2222 and 53 on TCP. Port 53 is also forwarded for UDP.

The Problem

The guest OS is running a website (mediawiki), which for the most part I have been able to get up and running. Using putty I have been able remote into the Linux OS to execute "apt-get install" commands and install software. This works OK because of the proxy settings I added in "/etc/apt/apt.conf.d/50htp-proxy". (I've had to take a 't' out of htp as I'm not allowed to submit URLs!)

The issue now is that other programs are unable to resolve internet host names. "sendmail" errors out with "unable to resolve host @mydomain dot com". Likewise a wget on google dot com fails in a similar way. I can, however, resolve internal host names to IPs. So the issue is restricted to internet domains. Can anyone offer any advise on a way forward? Perhaps I need to add the internet proxy setting in somewhere else too, but I don't know where.

Things I have tried to fix it

- Switching VBox config from host DNS settings to DNS proxy
- Adding port 53 into the port forwarding settings. (I didn't really think that was going to work)
- Switching to static IP in the Guest and defining the DNS servers manually. I pointed the settings in /etc/network/interfaces to the corporate DNS servers. I don't think this worked because they are in a very different IP range.

Thanks.

Re: Guest OS not always resolving Internet hostnames.

Posted: 12. Oct 2015, 00:46
by eddiegi686
Have you tried the http_proxy environment variable on Linux? This should enable applications like wget to work.

e.g. export http_proxy="http://proxy.server.name:8080"

Also please confirm what your default route is set to on the Linux Guest. The following command will give you this information:

Code: Select all

/sbin/route -n

Re: Guest OS not always resolving Internet hostnames.

Posted: 12. Oct 2015, 11:24
by Benny_Boy
The environment variable has been set for both htp and htps. The settings are identical to those used for apt-get.

When I run "/sbin/route -n" I get:
Destination     Gateway         Genmask           Flags Metric Ref    Use Iface
0.0.0.0         10.0.2.2        0.0.0.0           UG    0         0    0   eth0
10.0.2.0        0.0.0.0         255.255.255.0     U     0         0    0   eth0
169.254.0.0     0.0.0.0         255.255.0.0       U     1000     0      0   eth0
Interestingly running either of the commands below returns nothing or a blank line: (again I've had to remove a 't' from htp to allow me to submit this post.)

Code: Select all

env | grep -i proxy
echo $htp_proxy
I realise this is now more of a Linux question and getting off topic for this forum. I am searching for the answer else where as well.