# Unresolved host name

**URL:** <https://forums.docker.com/t/unresolved-host-name/103033>\
**Category:** General\
**Created:** [January 14, 2021, 9:39am UTC](https://forums.docker.com/t/unresolved-host-name/103033 "2021-01-14T09:39:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bachtuoctvsukien](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bachtuoctvsukien](https://forums.docker.com/u/bachtuoctvsukien)\
**Post date:** [January 14, 2021, 9:39am UTC](https://forums.docker.com/t/unresolved-host-name/103033/1 "2021-01-14T09:39:39Z")

</div>

Hi guys,

I’m trying to expose a container to the internet. I can make an HTTP request to an API inside docker using Postman, but when I try to call it from somewhere else ([tructiepbongda](https://bachtuoc.tv/)) i get an “Unresolved host name” error. Any ideas on how to fix this? Any help is highly appretiated.

---

<div class="post-metadata">

**Author:** ![letme](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@letme](https://forums.docker.com/u/letme)\
**Post date:** [January 18, 2021, 3:45pm UTC](https://forums.docker.com/t/unresolved-host-name/103033/3 "2021-01-18T15:45:10Z")

</div>

You have 2 options, if you are running this container interactively. First is to add resolve only for a specific host

`docker run -v $(pwd):/code --user $(id -u):$(id -g) --add-host="example.com:"$(getent hosts example.com | awk '{ print $1 }')"" --rm -ti imagename command`

Or add your own DNS to the container

`docker run -v $(pwd):/code --user $(id -u):$(id -g) --dns=$(getent hosts dns.example.com | awk '{ print $1 }') --rm -ti imagename command`
