{"record":{"id":"5bf57ffc3c06131f","repo":"docker/compose","slug":"invalid-dns-address-w","errorCode":null,"errorMessage":"invalid DNS address: %w","messagePattern":"invalid DNS address: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/create.go","lineNumber":381,"sourceCode":"\t// MISC\n\tresources := getDeployResources(service)\n\tvar logConfig container.LogConfig\n\tif service.Logging != nil {\n\t\tlogConfig = container.LogConfig{\n\t\t\tType:   service.Logging.Driver,\n\t\t\tConfig: service.Logging.Options,\n\t\t}\n\t}\n\tsecurityOpts, unconfined, err := parseSecurityOpts(p, service.SecurityOpt)\n\tif err != nil {\n\t\treturn createConfigs{}, err\n\t}\n\n\tvar dnsIPs []netip.Addr\n\tfor _, d := range service.DNS {\n\t\tdnsIP, err := netip.ParseAddr(d)\n\t\tif err != nil {\n\t\t\treturn createConfigs{}, fmt.Errorf(\"invalid DNS address: %w\", err)\n\t\t}\n\t\tdnsIPs = append(dnsIPs, dnsIP)\n\t}\n\n\thostConfig := container.HostConfig{\n\t\tAutoRemove:     opts.AutoRemove,\n\t\tAnnotations:    service.Annotations,\n\t\tBinds:          binds,\n\t\tMounts:         mounts,\n\t\tCapAdd:         service.CapAdd,\n\t\tCapDrop:        service.CapDrop,\n\t\tNetworkMode:    networkMode,\n\t\tInit:           service.Init,\n\t\tIpcMode:        container.IpcMode(service.Ipc),\n\t\tCgroupnsMode:   container.CgroupnsMode(service.Cgroup),\n\t\tReadonlyRootfs: service.ReadOnly,\n\t\tRestartPolicy:  getRestartPolicy(service),\n\t\tShmSize:        int64(service.ShmSize),","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/create.go#L363-L399","documentation":"Error \"invalid DNS address: %w\" thrown in docker/compose.","triggerScenarios":"A 'dns' entry in the service definition contains an IP address that cannot be parsed.","commonSituations":"Typo in the DNS server address, a hostname instead of an IP, or an empty/whitespace value in the dns list.","solutions":["Correct the dns entry in the compose file to a valid IP address (e.g. 8.8.8.8).","Remove the invalid dns entry and let Docker use its default resolver."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}