title: Add host mapping to /etc/hosts in Kubernetes
body: <p>I have an issue with the DNS mapping in kubernetes.</p>
  <p>We have some servers which can be accessed from internet. The global DNS translates these servers's domain names to public internet IPs.
  Some services can't access through public IPs for security consideration.</p>
  <p>From company internal, we add the DNS mappings with private IPs to /etc/hosts inside docker containers managed by kubernetes to access these servers manually.</p>
  <p>I know that docker supports command --add-host to change <code>/etc/hosts</code> when executing <code>docker run</code>. I'm not sure if this command supported in latest kubernetes, such as kuber <code>1.4</code> or <code>1.5</code> ?</p>
  <p>On the other hand, we can wrap the startup script for the docker container,</p>
  <ul>
  <li>append the mappings to <code>/etc/hosts</code> firstly</li>
  <li>start our application</li>
  </ul>
  <p>I only want to change the file once after first run in each container. Is there an easy way to do this because the mapping relations maybe different between develop and production environments or any commands related to this provided by kubernetes itself?</p>