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

Kohtala 31 Reputation points


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.


A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,471 questions
{count} vote

Accepted answer
  1. Dave Patrick 426.1K Reputation points MVP

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

    You can use the feedback hub

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

0 additional answers

Sort by: Most helpful