<p>I'm using <strong>Docker Desktop for mac</strong> for <strong>Kubernetes</strong> in local desktop. I'm trying to connect to DB installed on my local machine within a pod but can't figure what should be the host address. How can I relate to the address of my machine within a pod?</p>

<p>Please note that I can't use the ip of my machine since the db port is blocked in my network.</p>

Yaniv
<p>From docker 18.03 onwards, you can use special DNS name<code>host.docker.internal</code> which resolves to the internal address used by host.</p>
<p>Please look at the official docs <a href="https://docs.docker.com/docker-for-mac/networking/#per-container-ip-addressing-is-not-possible" rel="noreferrer">here</a> for more information on this.</p>
<p>If you're on earlier version than docker 18.03, you need to use the experimental DNS name <code>docker.for.mac.localhost</code> to resolve to the local host.</p>
<p>Hope this helps.</p>
