Hosts file being wrongly changed when connecting to a VPN

Hi all.

From time to time when I connect to a VPN my windows hosts file gets wrongly changed somehow.

hosts file gets multiple entries like this: host.docker.internal gateway.docker.internal
# Added by Docker Desktop host.docker.internal gateway.docker.internal
# To allow the same kube context to work on the host and the container: kubernetes.docker.internal
# End of section

And because of this I’m not able to run containers:

Cannot start service web: driver failed programming external connectivity on endpoint web_container (cc0a32e0ca68daca1cb593735cc183bbed9d9dd0c79e5086b05adf340b28f4c3): Error starting userland proxy: listen tcp
:19080: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted

After this I need to remove all entries from the hosts file and restart windows so that the hosts file gets correctly regenerated again

Question is: Why is my hosts file getting changed every time I connect to a VPN? Is there any way to prevent that?