Given a hosts file like:
127.0.0.1 localhost
10.0.0.100 otherhost # some comment
Adding a new configuration with hostile set 127.0.0.1 newhost adds the new host but removes the line comment from the existing entry, leaving
127.0.0.1 localhost
10.0.0.100 otherhost
127.0.0.1 newhost
I would expect this tool to leave existing line comments intact. I have other tooling which depends on their presence.