VMware Communities
giladb
Contributor
Contributor

Redundant DNS on host-only network

Some of my VMs have two NICS, one connected to bridged networking, and one to a host only network.

Both networks provide addresses by DHCP.

The problem is that the DHCP server on the host-only network is providing the VMs with a DNS server, which is totally useless, and overrides the real DNS server supplied by the DHCP server on the bridged network.

I can solve this by telling the (Linux-only) VMs to ignore DNS from this network.

I prefer a solution which would configure the (VMWare workstation) DHCP server NOT to provide DNS settings.

Can this be done ?

Thanks

0 Kudos
8 Replies
KevinG
Immortal
Immortal

> Some of my VMs have two NICS, one connected to bridged networking, and one to a host only network. Both networks provide addresses by DHCP.

Why are you using host-only? What are you trying to accomplish?

0 Kudos
giladb
Contributor
Contributor

Believe me, I tried them all Smiley Happy

I need network connectivity to the VM whether I am online or not.

I also need VM connection to the world.

Why not a NAT network then ? In some cases I need connection from the outside world into my VM, which a NAT network can't provide. This and two other factors which are a bit complex to explain (and definitely go beyond the scope of this thread)

0 Kudos
KevinG
Immortal
Immortal

What is your host OS?

0 Kudos
giladb
Contributor
Contributor

XP

0 Kudos
RDPetruska
Leadership
Leadership

Instead of using a host-only network, use a 2nd bridged network. To your host, add the Microsoft Loopback Connector network card. Run the Virtual Network Editor, and specify your physical NIC to bridge to VMnet0 and bridge VMnet2 to the loopback adapter. Then, in your VM change your 2nd virtual NIC to use a custom connection, and use VMnet2.

0 Kudos
KevinG
Immortal
Immortal

The virtual network adapters VMnet1 (Host-Only) and the virtual network adapter VMnet8 (NAT) installed on the host provide DHCP by default since this is a private network with no connection to the outside world. If you assign the second virtual network adapter in the virtual machine guest OS with a static IP on the same subnet as the Vmnet1 private network, you could go into the Windows XP Service control panel and stop the VMware DHCP Service.

0 Kudos
giladb
Contributor
Contributor

Both solutions suggested above seem more complex than my current solution, configuring the guest networking to ignore the DNS.

I guess I'll stay with the guest approach.

0 Kudos
DavidWoodward
Enthusiast
Enthusiast

I know I'm late to the game on this one, but I thought I'd share another solution to the problem in case someone else  runs into this.

I was having problems with Windows clients getting bogus DNS settings from VMware Player (3.1.4) also.  It actually causes quite a bit of delay between Windows 7 clients trying to communicate using NetBIOS since it tries DNS first.  The steps below essentially walk you through changing the VMware DHCP service to not provide DNS settings to your virtual network clients.

NOTE:  This is for Windows.  I'm not sure where the dhcp configuration file is on Linux but I'm sure once you find it the steps are pretty much the same.

1) Start -> Run -> services.msc

2) Stop "VMware DHCP Service"

3) Start -> Run -> notepad "%ALLUSERSPROFILE%\Application Data\VMware\vmnetdhcp.conf"

[ For Windows Vista/7 the path will be "%ALLUSERSPROFILE%\VMware\vmnetdhcp.conf" and you'll need to run notepad as administrator in order to make changes to the file ]

4) Find the section of settings for the virtual network you want to edit (ie. "# Virtual ethernet segment 2"), and then comment out the "option domain-name..." lines by prefixing them with a "#" character.  (ie. "option domain-name-servers 192.168.72.1;" = "#option domain-name-servers 192.168.72.1")

5) Close notepad and save the file.

6) Start -> Run -> services.msc

7) Start "VMware DHCP Service"

😎 Disconnect and reconnect any virtual machines from the client to force them to obtain new DHCP settings.

That's it.  From now on your clients should not receive any DNS settings from VMware for the network you changed.

0 Kudos