Resetting the DNS server list to static in Azure

The SharePoint 2013 development environment in Azure that i maintain contains a fully fledged AD/DNS infrastructure. To keep things lean, i did not want to maintain a separate infrastructure VM and just combine the roles. However, every time the machine is restarted, the IP interface settings needs to be adjusted. I need to ensure that the Azure provided DNS server needs to be come secondary DNS server in the list while loopback address stays as primary. I have not fully automated this just yet, but here is the command-line methods to get it done.

netsh interface ip "Ethernet 8" add dnsserver 127.0.0.1 primary
netsh interface ip add dnsserver "Ethernet 8" 100.112.12.40 index=2

To update the DNS services forwarder to the new server ip address:

import-module DnsServer
Set-DnsServerForwarder -IPAddress 100.112.12.40
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s