Question: I had problems with hostnames resolving in windows Linux-subsystem so I removed /etc/hosts and wrote new version of it. That solution solved my problem, but after every reboot system started overriding /etc/hosts by a some default version, so I need setup hosts again and again. 
Is it possible to setup linux subsystem so it copies original windows hosts file or at least doesn't delete already written file ?

Answer: 
Your issue is adressed here:
<https://github.com/Microsoft/BashOnWindows/issues/398>

To prevent WSL from automatically generating the /etc/hosts file on every bash startup, you need to remove the following comment line in /etc/hosts:

```
# This file was automatically generated by WSL. To prevent automatic generation of this file, remove this line.

```
I wrote the following zsh function based off of @R6D1H2's answer.

```
function addHosts() {
    declare -A MYHOSTS
    MYHOSTS=( 
        [host-1]="ip.add.re.ss"
        [host-2]="ip.add.re.ss"
        [host-3]="ip.add.re.ss"
        )

    for key value in ${(kv)MYHOSTS}; do
        grep $key /etc/hosts >> /dev/null || echo "$value $key" | sudo tee -a /etc/hosts >> /dev/null
    done
}

```