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

%3CLINGO-SUB%20id%3D%22lingo-sub-1278602%22%20slang%3D%22en-US%22%3ERegister%20only%20network%20adapter%20in%20DNS%20which%20is%20connected%20to%20company%20network%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1278602%22%20slang%3D%22en-US%22%3E%3CP%3EA%20client%20in%20a%20company%20network%20has%20multiple%20network%20adapters%20(e.g.%20VMware%20Workstation%2C%20Virtualbox%2C%20Docker).%20On%20all%20network%20adapters%2C%20the%20checkbox%20for%20%22Register%20this%20connection's%20addresses%20in%20DNS%22%20is%20checked%20by%20default.%20The%20client%20has%20multiple%20DNS%20entries%20in%20DNS%20with%20all%20IP%20addresses%20of%20all%20network%20adapters.%3C%2FP%3E%3CP%3EIf%20I%20uncheck%20%22Register%20this%20connection's%20addresses%20in%20DNS%22%20for%20a%20network%20adapter%2C%20this%20IP%20address%20is%20not%20registered%20in%20DNS%20anymore.%20This%20behaviour%20is%20expected%20and%20correct.%3C%2FP%3E%3CP%3EIt%20is%20not%20reasonable%20every%20user%20needs%20to%20configure%20this%20checkbox%20%22Register%20this%20connection's%20addresses%20in%20DNS%22%20on%20their%20own%20on%20all%20network%20adapters%20on%20their%20client.%3C%2FP%3E%3CP%3EAs%20an%20admin%2C%20how%20can%20I%20configure%20globally%20on%20all%20clients%20in%20the%20domain%20network%2C%20only%20the%20network%20adapter%20which%20is%20connected%20to%20the%20company%20network%2C%20is%20registered%20in%20DNS%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1278602%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDNS%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1769960%22%20slang%3D%22en-US%22%3ERe%3A%20Register%20only%20network%20adapter%20in%20DNS%20which%20is%20connected%20to%20company%20network%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1769960%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F164442%22%20target%3D%22_blank%22%3E%40Silvan%20Diem%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20came%20across%20this%20scenario%20recently.%20The%20way%20I%20found%20to%20make%20your%20suggestion%20work%20is%20using%20a%20script%20to%20disable%20the%20%22register%20this%20connection's%20address%20in%20DNS%22%20for%20all%20the%20NIC%20Adapters%20except%20when%20it%20has%20the%20%22domain%22%20property%20populated%20with%20the%20internal%20AD%20Domain%20(then%20it%20will%20register%20the%20connection).%3C%2FP%3E%3CP%3EThis%20is%20what%20I%20used%2C%20you%20can%20test%20and%20see%20if%20it%20also%20works%20for%20you%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24search%20%3D%20%22contoso.local%22%3CBR%20%2F%3E%24Reg%20%3D%20gci%20Registry%3A%3AHKLM%5CSYSTEM%5CCurrentControlSet%5CServices%5CTcpip%5CParameters%5Cinterfaces%3CBR%20%2F%3Eforeach%20(%24rkey%20in%20%24Reg.name)%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3E%24rvalues%20%3D%20Get-ItemProperty%20Registry%3A%3A%24rkey%3CBR%20%2F%3Eforeach%20(%24value%20in%20%24rvalues)%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3Eif%20(%24value.Domain%20-notmatch%20%24search)%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3Eif%20(Test-Path%20%22%24rvalues%5CRegistrationEnabled%22)%3CBR%20%2F%3E%7B%20%3CBR%20%2F%3ESet-ItemProperty%20-path%20%24value.PSPath%20-name%20RegistrationEnabled%20-value%20%220%22%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3Eelse%20%7B%20%3CBR%20%2F%3ENew-ItemProperty%20-path%20%24value.PSPath%20-name%20RegistrationEnabled%20-value%20%220%22%20-PropertyType%20DWORD%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20Regards%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHelen%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional 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
Highlighted

@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