Index: /trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
===================================================================
--- /trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp	(revision 64214)
+++ /trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp	(revision 64215)
@@ -115,4 +115,9 @@
     int initWithMain();
     HRESULT HandleEvent(VBoxEventType_T aEventType, IEvent *pEvent);
+
+    static int hostDnsServers(const ComHostPtr& host,
+                              const RTNETADDRIPV4& networkid,
+                              /* const */ AddressToOffsetMapping& mapping,
+                              AddressList& servers);
     int fetchAndUpdateDnsInfo();
 
@@ -611,4 +616,66 @@
 }
 
+
+/**
+ * @note: const dropped here, because of map<K,V>::operator[] which
+ * isn't const, map<K,V>::at() has const variant but it's C++11.
+ */
+int VBoxNetDhcp::hostDnsServers(const ComHostPtr& host,
+                                const RTNETADDRIPV4& networkid,
+                                /* const */ AddressToOffsetMapping& mapping,
+                                AddressList& servers)
+{
+    ComBstrArray strs;
+
+    HRESULT hrc = host->COMGETTER(NameServers)(ComSafeArrayAsOutParam(strs));
+    if (FAILED(hrc))
+        return VERR_NOT_FOUND;
+
+    /*
+     * Recent fashion is to run dnsmasq on 127.0.1.1 which we
+     * currently can't map.  If that's the only nameserver we've got,
+     * we need to use DNS proxy for VMs to reach it.
+     */
+    bool fUnmappedLoopback = false;
+
+    for (size_t i = 0; i < strs.size(); ++i)
+    {
+        RTNETADDRIPV4 addr;
+        int rc;
+
+        rc = RTNetStrToIPv4Addr(com::Utf8Str(strs[i]).c_str(), &addr);
+        if (RT_FAILURE(rc))
+            continue;
+
+        if (addr.au8[0] == 127)
+        {
+            /* XXX: here we want map<K,V>::at(const K& k) const */
+            if (mapping[addr] != 0)
+            {
+                addr.u = RT_H2N_U32(RT_N2H_U32(networkid.u)
+                                    + mapping[addr]);
+            }
+            else
+            {
+                fUnmappedLoopback = true;
+                continue;
+            }
+        }
+
+        servers.push_back(addr);
+    }
+
+    if (servers.empty() && fUnmappedLoopback)
+    {
+        RTNETADDRIPV4 proxy;
+
+        proxy.u = networkid.u | RT_H2N_U32_C(1U);
+        servers.push_back(proxy);
+    }
+
+    return VINF_SUCCESS;
+}
+
+
 HRESULT VBoxNetDhcp::HandleEvent(VBoxEventType_T aEventType, IEvent *pEvent)
 {
Index: /trunk/src/VBox/NetworkServices/NetLib/ComHostUtils.cpp
===================================================================
--- /trunk/src/VBox/NetworkServices/NetLib/ComHostUtils.cpp	(revision 64214)
+++ /trunk/src/VBox/NetworkServices/NetLib/ComHostUtils.cpp	(revision 64215)
@@ -119,46 +119,4 @@
 }
 
-/**
- * @note: const dropped here, because of map<K,V>::operator[] which isn't const, map<K,V>::at() has const
- * variant but it's C++11.
- */
-int hostDnsServers(const ComHostPtr& host, const RTNETADDRIPV4& networkid,
-                   /*const*/ AddressToOffsetMapping& mapping, AddressList& servers)
-{
-    servers.clear();
-
-    ComBstrArray strs;
-    if (SUCCEEDED(host->COMGETTER(NameServers)(ComSafeArrayAsOutParam(strs))))
-    {
-        RTNETADDRIPV4 addr;
-        int rc;
-
-        for (unsigned int i = 0; i < strs.size(); ++i)
-        {
-            rc = RTNetStrToIPv4Addr(com::Utf8Str(strs[i]).c_str(), &addr);
-            if (RT_SUCCESS(rc))
-            {
-                if (addr.au8[0] == 127)
-                {
-                    /* XXX: here we want map<K,V>::at(const K& k) const */
-                    if (mapping[addr] != 0)
-                    {
-                        addr.u = RT_H2N_U32(RT_N2H_U32(networkid.u)
-                                            + mapping[addr]);
-                    }
-                    else
-                        continue; /* XXX: Warning here (local mapping wasn't registered) */
-                }
-
-                servers.push_back(addr);
-            }
-        }
-    }
-    else
-        return VERR_NOT_FOUND;
-
-    return VINF_SUCCESS;
-}
-
 
 int hostDnsSearchList(const ComHostPtr& host, std::vector<std::string>& strings)
Index: /trunk/src/VBox/NetworkServices/NetLib/utils.h
===================================================================
--- /trunk/src/VBox/NetworkServices/NetLib/utils.h	(revision 64214)
+++ /trunk/src/VBox/NetworkServices/NetLib/utils.h	(revision 64215)
@@ -75,5 +75,4 @@
 
 int localMappings(const ComNatPtr&, AddressToOffsetMapping&);
-int hostDnsServers(const ComHostPtr&, const RTNETADDRIPV4&,/* const */ AddressToOffsetMapping&, AddressList&);
 int hostDnsSearchList(const ComHostPtr&, std::vector<std::string>&);
 int hostDnsDomain(const ComHostPtr&, std::string& domainStr);
