Connecting to the host windows machine


I’m faced the issue where “I WANT TO CONNECT FROM A CONTAINER TO A SERVICE ON THE HOST” to have behaviour that is described in the tutorial.

docker version and info

docker version output:

Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:21:34 2018
OS/Arch: windows/amd64
Experimental: false
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:29:02 2018
OS/Arch: linux/amd64
Experimental: false

docker info output:

Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 54
Server Version: 18.06.1-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
Profile: default
Kernel Version: 4.9.93-linuxkit-aufs
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.934GiB
Name: linuxkit-00155d300101
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: 28
Goroutines: 51
System Time: 2018-09-04T14:59:02.1098598Z
EventsListeners: 1
Registry: httxx://
Experimental: false
Insecure Registries:
Live Restore Enabled: false

The command that I’ve used:
docker --host host.docker.internal run --rm -d --network host --name my_nginx nginx

The result: "C:\Program Files\Docker\Docker\Resources\bin\docker.exe: error during connect: Post http://host.docker.internal:2375/v1.38/containers/create?name=my_nginx: dial tcp connectex: No connection could be made because the target machine actively refused it.

When I’ve tried to nslookup this “special DNS names like: gateway.docker.internal, host.docker.internal and for deprecated” I had:

Server:  localhost


*** localhost can't find host.docker.internal: Non-existent domain

What should I do to connect from a container to a service on the host?

Thanks in advance.