A common task when building a new site or changing the Domain Controllers in Microsoft Azure is to change the DNS Server configuration at the Virtual Network level. Microsoft recommends to restart the VM after changing the DNS settings, however there is a workaround that may be useful on your environment to save the restart time.
Let’s use a simple example, our environment is configured to use the 10.10.10.10 DNS server for the RG-VN-DefaultNW Virtual Network, as depicted in the image below.
If we change the DNS to use the default one (Azure provided) we will see a warning saying that the VMs that are using this Virtual Network must be restarted to use the new DNS settings.
There is a simple shortcut that works, connected to the VM, run this following command as administrator on the command prompt:
ipconfig /release && ipconfig /renew
The same procedure can be applied to AWS instances as well, when changing the DHCP scope of a VPC (Virtual Private Cloud).