Hi,
tldr version:
On multihomed server with 2 NICs when trying to resolve it's own hostname to IP I always get IP of NIC with higher interface index which is not a domain NIC and can't find a setting that would allow me to control this. This is a problem if an app uses server hostname to get it's IP address.
Full version.
I've got Windows Servers 2012 R2 (and 2012) in my infrastructure. Some are VM and others use windows nic teaming. All have 2 NICs (or virtual NICs) in two different networks - Domain network and Management network.
Let's say my server hostname is dpm01 and domain is contoso.com. Domain network address is 172.23.1.1/16 and Management address is 172.29.0.2/24.
So dpm1.contoso.com is 172.23.1.1
When I'm trying to resolve the name "dpm1" or "dpm01.contoso.com" to IP address I get 172.29.0.2. I'm doing it by using ping and I know that I have an application that is also doing such a resolution and getting the same result as I am with ping.
Question is what do I do to get 172.23.1.1 for "dpm01.contoso.com" when pinging from it ???
What I know or tried:
1. This is NOT a DNS problem. nslookup returns proper result from dns server. DNS registration is disabled on all NICs and on DNS server.
2. Tried adding dpm1 and dpm01.contoso.com in hosts file - nothing.
3. 172.29.0.2/24 does not have a default gateway, has NetBIOS disabled and for testing I disabled in NIC properties everything besides IPv4 and "QoS packet scheduler". There are no DNS servers configured for this NIC. LMHOSTS lookup is also disabled.
4. I've changed interface binding order so that Domain network is on top, confirmed in registry and rebooted. No help.
5. Every other server when pinging dpm01 uses DNS so they get proper address of 172.23.1.1 so as in 1 - this is NOT a DNS problem.
6. Domain NIC has interface index 12, Management NIC has index 13, if I switch them then I get proper results, but I'm looking for a solution that does not require me to reconfigure NICs on all my servers based on random order they get (in VM). Seriously I should not have to address NIC based on its interface index...
I would appreciate any help with this issue.