Docker Community Forums

Share and learn in the Docker community.

Unable to resolve host.docker.internal when using custom DNS

host.docker.internal works just fine, except that I need to use custom DNS in docker-composer.yml (we do a bunch of local DNS lookups), and if I add these, host.docker.internal no longer resolves.

version: ‘3.7’

services:
webserver:
build:
context: ‘./docker/apache/’
image: intranet
links:
- memcached
ports:
- ‘8080:80’
volumes:
- .:/var/www/html
- c:/inetpub/intranet_assets:/var/www/intranet_assets
environment:
XDEBUG_CONFIG: remote_host=host.docker.internal
DOCKER_CONTAINER: 1
dns:
- 192.168.0.16
- 192.168.0.19
memcached:
build:
context: ‘./docker/memached/’

1 Like