Tag Archives: windows hyper-v remote dns

When remote desktop does not connect: changing Windows DNS setttings remotely

This was an annoying. I tried to remote desktop into my Hyper-V Server today and could not. The message:

Remote Desktop cannot verify the identity of the remote computer because there is a time or date difference between your computer and the remote computer.

image

Hmm. I typed:

net time \\myhypervbox

and it was the same as the time on my desktop.

A Google or two later, and I discovered that this message is caused by an incorrect DNS setting on the target computer. That made sense, since a DNS server died recently. I had changed the settings on the VMs but forgot to do it on the Hyper-V host. Thank you Microsoft for a misleading error message.

Of course my Hyper-V server has no screen attached. So how to change the DNS setting? Umm, not by remote desktop.

I fiddled with netsh for a bit. This looks promising, but it was not playing ball. I tried to list the interfaces and it gave an error saying it could not do so when remote access is not running. Further, I have two network cards in this machine, and Hyper-V creates virtual interfaces, and I was not sure what the correct network interface name was.

Next up was the registry editor. Run Regedit, choose File – Connect Network Registry. That worked. I went to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tcpip\Parameters\Interfaces

This lists the network interfaces as GUIDs. I went through them one by one, and in the two cases where the NameServer entry was set to the dead server, I changed it to the new one.

There is also an entry for NameServer in the top level Parameters key but this was blank and I left it alone.

If you want to know what all these keys do, there is a guide here.

I rebooted the machine, remotely of course:

shutdown /m \\myhypervbox /r

and when it restarted remote desktop worked again.