After setting up your docker machine, change the dns opts to look for a locally running DNS server...
docker-machine ssh
sudo vi /var/lib/boot2docker/profile
# Then add the following...
EXTRA_ARGS='
--label provider=virtualbox
--dns 172.17.0.1
--dns-search dev
'
Then run the following container...
docker run -d -v /var/run/docker.sock:/var/run/docker.sock --restart="always" --name dnsdock -p 172.17.0.1:53:53/udp aacebedo/dnsdock
Then install dnsmasq
brew install dnsmasq
And create the file with /usr/local/etc/dnsmasq.conf
address=/dev/192.168.99.100
(The ip comes from docker-machine ip
)
sudo route -n add 172.17.0.0/16 $(docker-machine ip)
https://www.snip2code.com/Snippet/1164048/custom-docker-wrapper-for-osx