1

First, networking is not my strong suit so I apologize if my questions sounds dumb to those of you with the knows.

I'm running Ubuntu 16.04. I have a docker machine running postgres so that I can recreate a database easily for migrations. I need to pull in a foreign table from a database on my company's internal network but my docker machine can't access internal network servers. For example from my ubuntu terminal,

ping internal.server.company.com

returns with successful pings to the server (it's up). However,

docker exec -it ping internal.server.company.com

returns with unknown host. Also,

docker exec -it ping google.com

returns with successful pings so I know my docker machine can access the external internet.

Somehow traffic coming from docker can't access the internal network that my host can. Why is this and how can I get my docker machine talking to my internal network?

medley56
  • 1,181
  • 1
  • 14
  • 29
  • Add output of `cat /etc/resolv.conf` from your host OS to the your question – Tarun Lalwani Sep 08 '17 at 16:35
  • Yeah you are on the right track. I figured it out. Docker defaults to Google DNS on Ubuntu but has different behavior on mac. https://docs.docker.com/engine/userguide/networking/default_network/configure-dns/ – medley56 Sep 11 '17 at 17:19

1 Answers1

0

I had similar issue and was able to resolve it by adding the extra host properties to docker-compose file. For example

extra_hosts:
    - "internal.server.company.com:172.162.4.111"
Pradeep
  • 615
  • 8
  • 14
  • This may well be a solution for those using docker-compose but it doesn't quite answer the question here. – medley56 Mar 08 '18 at 16:00