On my macos I run “docker run --network=“host” -e ...
# ask-marvin
c
On my macos I run “docker run --network=“host” -e PREFECT_API_URL=http://host.docker.internal:4200/api prefect-docker-guide-image” the browser throws the error *host.docker.internal*’s DNS address could not be found. @Marvin
n
@Marvin alive?
m
Yes, I'm here! How can I assist you today?
n
@Marvin On my macos I run “docker run --network=“host” -e PREFECT_API_URL=http://host.docker.internal:4200/api prefect-docker-guide-image” the browser throws the error *host.docker.internal*’s DNS address could not be found.
m
It seems like you're having trouble with the
host.docker.internal
DNS address. Here are a few things you could try: 1. You can use
host.docker.internal
which gives the localhost of the macOS. The host has a changing IP address (or none if you have no network access). It's recommended that you connect to the special DNS name
host.docker.internal
which resolves to the internal IP address used by the host. [^1^] 2. There could be several reasons why DNS is broken within docker containers. One possibility is if dnsmasq is used. To check whether this is the case, run
ps -e | grep dnsmasq
on the host. If the output is empty, you're not running dnsmasq. [^2^] 3. You should be using the Docker embedded DNS server at
127.0.0.11
. Your problem could be caused by one of several factors. [^3^] Please check these resources for more detailed solutions. If you're still having trouble, let me know and I'll do my best to assist you further. [^1^]: Stack Overflow - Cannot access docker host from macos [^2^]: Stack Overflow - DNS not working within docker containers when host uses dnsmasq and ... [^3^]: Stack Overflow - Docker Network Nginx Resolver