compose: Docker Desktop 4.0.0 dns Not Working Properly to External Hostname

When running docker-compose up --build for the following example yaml file. The dns seems not working properly. The service tries to reach to external network, but docker produces error: getaddrinfo ENOTFOUND login.microsoftonline.com

version: "3.9"
services:
  alerts-service:
    build:
      dockerfile: ./Dockerfile
    command: npm run start
    env_file:
      - 'variables.env'

To me, it seems like docker failed to resolve the external hostname login.microsoftonline.com.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (1 by maintainers)

Most upvoted comments

@gvanriper let’s hope hat a permanent solution is provided

I agree. It’s just a simple workaround for now.

@gvanriper let’s hope that a permanent solution is provided

Hey all, I was able to get the issue again. I confirmed adding a host record to docker compose did in fact fix the issue. I would not consider this a solution but rather a temporary fix to get development moving.

image

extra_hosts:
  - "login.microsoft.com:40.126.29.14"

You may ping login.microsoft.com to update the IP. I did confirm that this IP seems to consistently work.

EDIT: I realized the original request was login.microsoftonline.com. This was my fault. Same logic works though:

extra_hosts:
  - "login.microsoftonline.com:40.126.28.14"

Same problem for me after the update (worked for 2 years flawless before). Downgraded to 3.6 again but suddenly same problem occurs with 3.6. Can’t find the problem here. Changed DNS to manual 1.1.1.1/8.8.8.8, no effect.

Checked Ping: /data/app # ping login.microsoft.com ping: bad address ‘login.microsoft.com’

Checked NSLookup: /data/app # nslookup login.microsoft.com Server: 127.0.0.11 Address: 127.0.0.11:53

Non-authoritative answer:

Non-authoritative answer: login.microsoft.com canonical name = a.privatelink.msidentity.com a.privatelink.msidentity.com canonical name = prda.aadg.msidentity.com prda.aadg.msidentity.com canonical name = www.tm.a.prd.aadg.trafficmanager.net www.tm.a.prd.aadg.trafficmanager.net canonical name = dub2.next.a.prd.aadg.trafficmanager.net prda.aadg.msidentity.com canonical name = www.tm.a.prd.aadg.akadns.net a.privatelink.msidentity.com canonical name = prda.aadg.msidentity.com

@katermikesch777 I had the exact same problem with 4.x and with 3.6. Downgrading to 3.5.2 seems to have fixed the problem, however. Maybe give that a try.