# Host.docker.internal missing in Linux (Ubuntu)

**URL:** <https://forums.docker.com/t/host-docker-internal-missing-in-linux-ubuntu/137535>\
**Category:** General\
**Created:** [September 4, 2023, 7:02pm UTC](https://forums.docker.com/t/host-docker-internal-missing-in-linux-ubuntu/137535 "2023-09-04T19:02:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edwinbradford](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@edwinbradford](https://forums.docker.com/u/edwinbradford)\
**Post date:** [September 4, 2023, 7:02pm UTC](https://forums.docker.com/t/host-docker-internal-missing-in-linux-ubuntu/137535/1 "2023-09-04T19:02:04Z")

</div>

I’m trying to resolve an issue redirecting curl from a Docker container to the host and seeing a lot of references to `host.docker.internal` and `host-gateway` which appear to have no effect and are not in my `/etc/hosts` file in Ubuntu where other people indicate.

Is this correct? I’m not clear whether these addresses exist for Linux as it looks like they didn’t originally but should now and if they are supported on Linux is there a way to verify they are working?

OS Version  
Ubuntu (WSL2 on Windows)

Client and Server Docker Engine  
24.0.5

Steps to Reproduce

1. In Ubuntu terminal enter: `cat /etc/hosts`

2. Observe the output:

```auto
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateHosts = false
127.0.0.1 localhost
127.0.1.1 AM5. AM5

127.0.0.1 mysite.localhost
127.0.0.1 phpmyadmin.localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/bluepuma77/32/32688_2.png) [@bluepuma77](https://forums.docker.com/u/bluepuma77)\
**Post date:** [September 4, 2023, 7:12pm UTC](https://forums.docker.com/t/host-docker-internal-missing-in-linux-ubuntu/137535/2 "2023-09-04T19:12:29Z")

</div>

> [@edwinbradford](#):
>
> host.docker.internal

is a feature of Docker Desktop. On Linux (servers) this is usually not installed. From within the container you can not access your hosts localhost (127.0.0.1).

See [similar discussion](https://forums.docker.com/t/host-docker-internal-in-production-environment/137507/1).

---

<div class="post-metadata">

**Author:** ![edwinbradford](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@edwinbradford](https://forums.docker.com/u/edwinbradford)\
**Post date:** [September 4, 2023, 7:20pm UTC](https://forums.docker.com/t/host-docker-internal-missing-in-linux-ubuntu/137535/3 "2023-09-04T19:20:27Z")

</div>

That answers that question then, thanks. That link has a lot of further information, I’ll see if I can get anywhere after reading it in more detail.
