Register only network adapter in DNS which is connected to company network

Copper Contributor

A client in a company network has multiple network adapters (e.g. VMware Workstation, Virtualbox, Docker). On all network adapters, the checkbox for "Register this connection's addresses in DNS" is checked by default. The client has multiple DNS entries in DNS with all IP addresses of all network adapters.

If I uncheck "Register this connection's addresses in DNS" for a network adapter, this IP address is not registered in DNS anymore. This behaviour is expected and correct.

It is not reasonable every user needs to configure this checkbox "Register this connection's addresses in DNS" on their own on all network adapters on their client.

As an admin, how can I configure globally on all clients in the domain network, only the network adapter which is connected to the company network, is registered in DNS?

1 Reply

@Silvan Diem 

I came across this scenario recently. The way I found to make your suggestion work is using a script to disable the "register this connection's address in DNS" for all the NIC Adapters except when it has the "domain" property populated with the internal AD Domain (then it will register the connection).

This is what I used, you can test and see if it also works for you:

 

$search = "contoso.local"
$Reg = gci Registry::HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\interfaces
foreach ($rkey in $Reg.name)
{​​​​​​​
$rvalues = Get-ItemProperty Registry::$rkey
foreach ($value in $rvalues)
{​​​​​​​
if ($value.Domain -notmatch $search)
{​​​​​​​
if (Test-Path "$rvalues\RegistrationEnabled")
{​​​​​​​
Set-ItemProperty -path $value.PSPath -name RegistrationEnabled -value "0"
}​​​​​​​
else {​​​​​​​
New-ItemProperty -path $value.PSPath -name RegistrationEnabled -value "0" -PropertyType DWORD
}​​​​​​​
}​​​​​​​

}​​​​​​​
}​​​​​​​

 

Best Regards,

 

Helen