Cannot Resolve Host on api.nuget.org From Within Docker-From-Docker-Compose Container on WSL
- VSCode Version:1.67.2
- Local OS Version: Windows 10 21H2 Build 19044.1708, running WSL v2 Ubuntu 20.04
- Local chip architecture: x86
- Reproduces in: Remote - Containers
- Name of Dev Container Definition with Issue: Docker From Docker Compose
Steps to Reproduce:
- Open Ubuntu shell via WSL v2
- Create new empty directory -
mkdir test - Open VS Code in empty directory -
code test - Use command palette to invoke "Remote-Containers: Add Development Container Configuration Files..." command
- Select "Docker from Docker Compose" container definition and accept all defaults
- Use command palette to invoke "Remote-Containers: Reopen in Container" action
- Open bash shell and run
curl api.nuget.orgresponse is:
curl: (6) Could not resolve host: api.nuget.org
Additional Notes:
- I tried the same steps as above but with the "Docker From Docker" container definition (i.e. no compose) and I did not get the same error
- This may be related, but seems slightly different from the issue I opened earlier today: #1470
- when comparing between the Docker From Docker vs the Docker From Docker Compose containers,
/etc/hosts,/etc/nsswitch.conf, and/etc/resolv.confall match - I tested that
curl google.comworks:
301 Moved 301 Moved
The document has moved here.
- I installed
hostanddnsutils, results are as follows:$ host -v api.nuget.org>
Trying "api.nuget.org" ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33132 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION: ;api.nuget.org. IN A
Received 31 bytes from 127.0.0.11#53 in 10 ms Trying "api.nuget.org" ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22994 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION: ;api.nuget.org. IN AAAA
Received 31 bytes from 127.0.0.11#53 in 0 ms Trying "api.nuget.org" ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18793 ;; flags: qr rd; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION: ;api.nuget.org. IN MX
;; ANSWER SECTION: api.nuget.org. 0 IN CNAME nugetapiprod.trafficmanager.net. nugetapiprod.trafficmanager.net. 0 IN CNAME apiprod-mscdn.azureedge.net. apiprod-mscdn.azureedge.net. 0 IN CNAME apiprod-mscdn.afd.azureedge.net. apiprod-mscdn.afd.azureedge.net. 0 IN CNAME star-azureedge-prod.trafficmanager.net. star-azureedge-prod.trafficmanager.net. 0 IN CNAME dual.part-0043.t-0009.t-msedge.net. dual.part-0043.t-0009.t-msedge.net. 0 IN CNAME part-0043.t-0009.t-msedge.net.
Received 239 bytes from 127.0.0.11#53 in 60 ms
$ nslookup -debug api.nuget.org >
Server: 127.0.0.11 Address: 127.0.0.11#53
QUESTIONS: api.nuget.org, type = A, class = IN ANSWERS: AUTHORITY RECORDS: ADDITIONAL RECORDS:
Non-authoritative answer:
QUESTIONS: api.nuget.org, type = AAAA, class = IN ANSWERS: AUTHORITY RECORDS: ADDITIONAL RECORDS:
*** Can't find api.nuget.org: No answer
Two more notes that may be relevant:
-
$ curl api.nuget.orgworks from the WSL bash shell (i.e. not inside the dev container. - I am not able to reproduce this issue when running Docker for Windows using Hyper-V driver (haven't checked what happens if I switch Windows Docker to use WSL driver)
same for me. Any news? Thanks
Facing same issue with windows container, when trying to ping from within windows container it is not able to resolve dns

**note above image is running command from container in -it mode
Same for me, also. Any news?
@Livius90 , finally discovered there was a certificate issue, since I was behind firewall and it was blocking my requests. How this issue was resolved was by using a cert in container and it then used this cert to connect/download nugets and finally it was able to resolve this.