title: How to auto-configure hosts entry for multiple docker-machine VMs (OS X)
body: <p>For a long time I only had one Docker VM on my laptop (first via boot2docker, then via docker-machine).</p>
  
  <p>In this case it was easy, the Docker VM always had the same IP address and I could manually edit my <code>/etc/hosts</code> file to add a name like <code>mysite.local</code> pointing to the docker IP.</p>
  
  <p>But recently I had to set up a second docker-machine VM. Now, I guess depending which order I start them up, my containers may be on one of two IP addresses. So my hand-made <code>/etc/hosts</code> entries don't always work.</p>
  
  <p>I don't want to have to edit this file by hand every time. I'm looking for a way to automate it.</p>