HYPER-V Default Switch corrupts hosts.ics and DNS stops working

asked 2021-11-18T11:22:34.667+00:00
Kohtala 21 Reputation points

Hi.

I've seen Linux guests (I only run Linux VMs) losing access to DNS occasionally with HYPER-V on up to date Windows 10. They get no response from the DNS server on Default Switch. I've managed to track down that at those times the %SystemRoot%\System32\drivers\etc\hosts.ics has some corruption. It seems like the hosts and addresses have got updated and it rewrote the hosts.ics file contents, but as the new contents were smaller than the old file, it fails to truncate the file to smaller size. So there is garbage from old contents at the end.

Sometimes this results in file containing two lines for same host and the host name resolves to an old IP address that does not respond, so you can not reach the VM from the host either or it times out on wrong address first. ipconfig /flushdns does not help, because the wrong entry is read from hosts.ics and does not flush from the cache.

Editing the file to remove the garbage and disabling and re-enabling the Default Switch adapter from host Control Panel Network adapters resets the DNS server and it starts working again.

However it is really annoying and takes time from work I need to do with the VMs. VMs have their network interrupted for the fix. Searching forums gives lots of reports people having issues that sound quite similar. Unfortunately they fail to contain full contents of this hosts.ics.

How does one report bugs in Windows products? This trivial bug has been there for years.

I moved my VM:s under HYPER-V in 2019 and the bug was there already then and remained through all upgrades.

Marko

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
1,818 questions
No comments
{count} votes

Accepted answer
  1. answered 2021-11-18T14:02:02.233+00:00
    Dave Patrick 328.8K Reputation points Microsoft MVP

    How does one report bugs in Windows products? This trivial bug has been there for years.

    You can use the feedback hub
    https://support.microsoft.com/en-us/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332

    --please don't forget to upvote and Accept as answer if the reply is helpful--


0 additional answers

Sort by: Most helpful