Skip to content

Instantly share code, notes, and snippets.

@MatthewJDavis
Created July 27, 2017 20:40
Show Gist options
  • Select an option

  • Save MatthewJDavis/85b93d15ef222f504524cc4d0aae033f to your computer and use it in GitHub Desktop.

Select an option

Save MatthewJDavis/85b93d15ef222f504524cc4d0aae033f to your computer and use it in GitHub Desktop.
Update the VNET DNS server settings
# config settings - get DNS Server addresses from the portal under the AAD Domain Services blade
$vnetName = 'northeurope-vnet'
$vnetRg = 'domain-services-rg'
$dnsServer1 = '10.0.0.4'
$dnsServer2 = '10.0.0.5'
$vnet = get-azurermvirtualnetwork -Name $vnetName -ResourceGroupName $vnetRg
# Add the DNS Server values to the VNET var
$vnet.DhcpOptions.DnsServers = $dnsServer1
$vnet.DhcpOptions.DnsServers += $dnsServer2
# set the DNS servers for the vnet
Set-AzureRmVirtualNetwork -VirtualNetwork $vnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment