At work, I needed to run a Docker container with a Rails application that talked to another application running inside a VMWare virtual machine. Adding to the complexity, I use boot2docker, which runs inside of VirtualBox.
If I only needed to access
api.localdomain.dev from my Mac, I could have simply edited
/etc/hosts and set both domains to resolve to
127.0.0.1 and been
done with it. Unfortunately, Rails needed to be able to directly
resolve the API server.