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:

192.168.2.124 host.docker.internal
192.168.2.124 gateway.docker.internal
# Added by Docker Desktop
192.168.2.179 host.docker.internal
192.168.2.179 gateway.docker.internal
# To allow the same kube context to work on the host and the container:
127.0.0.1 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 0.0.0.0
: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?

Thanks!