We may need some more details about your setup and use-case.  Here's a link stating that hosts defined in /etc/hosts are not inherited, but it does show how to add entries to the container hosts file.  Let us know if this doesn't match your use-case.
Docker DNS