Network Virtualization and DNS registration using PowerShell

Share this:

Using a simple PowerShell cmdlet to remove the DNS registration on Virtual NIC (vNICs) created by Virtual Machine Manager.

Solution


This Tutorial was created to remove the DNS Registration of Virtual NICs created using Virtual Machine Manager, however it can be used in several situations where the goal is to remove that flag using PowerShell.

In this scenario we are using a consistent naming convention, as shown in the image below, and all Virtual NICs (all adapters starting with vEthernet) do not require registration in DNS.

image

However, by default any new adapter on the Operating System will have that option checked on the DNS tab, as shown in the image below.

image

So, PowerShell to the rescue! Since we have a consistent naming convention and all vNICs shouldn’t have that configuration we can use the following cmdlet to list all vNICs

Get-NetAdapter vEthernet*

Now that we tested and we have all of them being listed, we can add the following cmdlet and it will disable registration on all vNICs being listed from the first cmdlet.

Get-NetAdapter vEthernet* | Set-DNSClient –RegisterThisConnectionAddress $False

In order to validate if the operation was performed successfully, we can run the following cmdlet and the value of False should be listed on the RegisterThisConnectionAddress column.

Get-NetAdapter vEthernet* | Get-DNSClient

The result of the three cmdlets above are summarized on the image below.

image

We can always check the configuration using the Graphical User Interface, and now the setting Register this connection’s address in DNS should be unchecked.

image

Using this simple cmdlets the administrator can control the DNS registration with a few commands. In environments that do not share a consistent naming convention, the administrator may have to be creative on the Get-NetAdapter cmdlet to list all adapters that are going to configured, or run the same command using the specific name of the adapter several times.

Written by Anderson Patricio

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at ITPROCentral.com, MSExchange.org, Techgenix.com and Anderson Patricio.org (Portuguese).

Related Post

Virtual Switches improvements in VMM 2016 TP4 Administrator that already take advantage of VMM 2012 R2 to virtualize networks and reduce operational cost managing servers will love this new featur...
How to update the VMM agent After updating the VMM Server, the administrator has an additional task to perform which is the VMM agent update on all hosts managed by the VMM. Sol...
Integration between Hyper-V Network Virtualization... One of features on Windows Server 2012 R2 that was improved since the last version is network virtualization. Virtual networks are created by using Hy...
System Center Virtual Machine Manager – Solv... In some scenarios, a refresh host or configurations to be applied on a Hyper-V host can fail with error 2912 (NO_PARAM). In this Tutorial, we are goin...