To access the host from inside a Docker container, you can use host.docker.internal as a hostname, at least if you're on a Windows or Mac host.

From the Windows command prompt:

C:\>docker run --rm alpine nslookup host.docker.internal

Non-authoritative answer:
Name:   host.docker.internal
Final thoughts

Weird how in Linux there's quite a convoluted workaround to do this.

Previous on Docker