/etc/hosts file overwritten at container restart

I've found a solution in this thread: HOWTO: Using pi-hole as LAN DNS server

Added a 02-lan.conf file in /etc/dnsmasq.d with content:

addn-hosts=/etc/pihole/lan.list

And added my local hostnames to the lan.list file in /etc/pihole

Thanks @jfb for pointing me towards dnsmasq as a possible solution.