Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HNSEndpoint DNSServerList is ignored in 10.0.17733 #297

Closed
arjun024 opened this issue Aug 22, 2018 · 2 comments
Closed

HNSEndpoint DNSServerList is ignored in 10.0.17733 #297

arjun024 opened this issue Aug 22, 2018 · 2 comments

Comments

@arjun024
Copy link

After running the latest Windows Insider build for 2019 (10.0.17733), we noticed that the DNSServerList for HNSEndpoint is ignored.

Steps to reproduce this error:

  • Assuming we have a container and a nat network
  • When we run the following program with ContainerId and NetworkName
package main

import (
	"fmt"
	"os"

	"github.com/Microsoft/hcsshim"
)

func main() {
	containerName := os.Args[1]
	networkName := os.Args[2]
	endpoint := &hcsshim.HNSEndpoint{
		VirtualNetworkName: networkName,
		Create a ComputeProcess containerName:               containerName,
	}

	endpoint.DNSServerList = "222.111.111.222,123.123.123.123"

	newEndpoint, err := endpoint.Create()
	if err != nil {
		fmt.Printf("Endpoint creation failed- %s\n", err.Error())
	}

	err = hcsshim.HotAttachEndpoint(containerName, newEndpoint.Id)
	if err != nil {
		fmt.Printf("Attaching endpoint failed\n")
	}

}
  • We expect to see the (Get-DNSClientServerAddress).ServerAddresses to contain 222.111.111.222 and 123.123.123.123 in the container, but we observe that it is blank. This behavior is working as expected in 1709 and 1803 builds.

docker info:

Containers: 2
 Running: 0
 Paused: 0
 Stopped: 2
Images: 12
Server Version: master-dockerproject-2018-08-15
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd gelf json-file logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 17733 (17733.1000.amd64fre.rs5_release.180803-1525)
Operating System: Windows Server Datacenter Version 1803 (OS Build 17733.1000)
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 32GiB
Name: WIN-8SUSKTQISJR
ID: BZ5Q:F572:PJZR:BLWE:TRIN:JWCP:FPSK:Q7ZH:UZCY:53NM:VCTY:HT5X
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
@pradipd
Copy link
Contributor

pradipd commented Aug 22, 2018

@arjun024 Can you add the commands to create the container and network?
I've tried to repro on 17733 and couldn't repro. I tried the following:

  1. docker run -d --rm -it --network none --name test windowsservercore powershell sleep 50000
  2. nat.
  3. docker exec test ipconfig /all
    DNS Servers . . . . . . . . . . . : 222.111.111.222
    123.123.123.123

And, I also tried creating my own nat network using:
docker network create --driver=nat n

And I get the same result as above.

Thanks.

@ankeesler
Copy link

@pradipd thank you for trying this out. We were able to reproduce the behavior that you saw above using the mcr.microsoft.com/windowsservercore-insider:10.0.17733.1000 container image.

However, this issue seems to still exist when we disable the dnscache service in a child container image. When we add this line in a Dockerfile that uses mcr.microsoft.com/windowsservercore-insider:10.0.17733.1000 as its base image, we are able to reproduce the original behavior that we reported in this github issue. We originally made this change to our container image to resolve DNS flakiness from inside the container (see #150). Per the most recent comment in that github issue, it sounds like we can keep the dnscache service on in our container image. We will try this going forward.

@arjun024 arjun024 closed this as completed Jun 4, 2020
dcantah pushed a commit to dcantah/hcsshim that referenced this issue Mar 17, 2021
gcs: Prevent GCS crashing when external process exits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants