Add/Update DNS servers for Azure VM

Log onto Azure > Find VM > Operations, Run Command > Run PowerShell Script

Get-NetAdapter | Select-Object InterfaceAlias , InterfaceIndex

Take a note of the InterfaceIndex

Get-DnsClientServerAddress -InterfaceIndex 7

Checks current DNS servers.

Set-DnsClientServerAddress -InterfaceIndex 7 -ServerAddresses (“″,”″,””)

Sets DNS servers


PS equivalent of Ipconfig /registerDNS

Get-DnsClientServerAddress -InterfaceIndex 7

Check interface for new DNS servers

Leave a Reply

%d bloggers like this: