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 (“10.215.153.11″,”168.63.129.16″,”10.230.160.15”)

Sets DNS servers

Register-DnsClient

PS equivalent of Ipconfig /registerDNS

Get-DnsClientServerAddress -InterfaceIndex 7

Check interface for new DNS servers

Exit mobile version
%%footer%%