Same issue here - some commands seem to resolve the name very quickly, others take up to 10s.
With Docker Machine at least you could check for $DOCKER_HOST
to find the IP, or assume localhost
. Docker for Mac seems to be a step in the right direction with docker.local
but resolution time of 10s makes it kind of useless for many applications.