Can't connect to VM after changing the DNS server address.

Tom346 26 Reputation points
2021-11-08T17:03:08.157+00:00

I recently had an issue with web connectivity so I tried changing the DNS server address within the OS via network connectors, properties and then internet protocol version 4. I changed it to Google Public DNS (Preferred - 8.8.8.8, Alternate - 8.8.4.4.

As soon as I clicked save settings I was disconnected and I have not been able to connect to the VM since.

Why has it disconnected me by changing to Googles Public DNS and is there a way to reset the network settings (DNS specifically) without having access to the VM?

Thanks,
Tom

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,086 questions
Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,358 questions
0 comments No comments
{count} vote

Accepted answer
  1. Alan Kinane 16,786 Reputation points MVP
    2021-11-08T19:58:27.55+00:00

    The IP address and DNS settings should not be configured through the OS for Azure VMs but instead on the network interface resource. You can reset the IP address as follows: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/reset-network-interface

    You can reset the DNS settings on the NIC as per here: https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface#change-dns-servers

    If all else fails then you may need to user PowerShell to reset the settings or use the serial console.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Liu, Oscar (Shenzhen) 1 Reputation point
    2022-05-15T00:44:26.193+00:00

    IP, subnet mask and gateway are still obtained automatically in the guest OS.
    After we manual set the DNS server in the guest OS, we can still connect to this VM via another VM in Azure, but it is unreachable from some computers out of Azure which pass through WAN.

    0 comments No comments