{"record":{"id":"be901e232012ea23","repo":"grafana/k6","slug":"lookup-s-no-such-host","errorCode":null,"errorMessage":"lookup %s: no such host","messagePattern":"lookup (.+?): no such host","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/netext/dialer.go","lineNumber":164,"sourceCode":"\n\tif d.Hosts != nil {\n\t\tremote, e := d.getConfiguredHost(addr, host, port)\n\t\tif e != nil || remote != nil {\n\t\t\treturn remote, e\n\t\t}\n\t}\n\n\tif ip != nil {\n\t\treturn types.NewHost(ip, port)\n\t}\n\n\tip, err = d.Resolver.LookupIP(host)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif ip == nil {\n\t\treturn nil, fmt.Errorf(\"lookup %s: no such host\", host)\n\t}\n\n\treturn types.NewHost(ip, port)\n}\n\nfunc (d *Dialer) getConfiguredHost(addr, host, port string) (*types.Host, error) {\n\tif remote := d.Hosts.Match(addr); remote != nil {\n\t\treturn remote, nil\n\t}\n\n\tif remote := d.Hosts.Match(host); remote != nil {\n\t\tif remote.Port != 0 || port == \"\" {\n\t\t\treturn remote, nil\n\t\t}\n\n\t\tnewPort, err := strconv.Atoi(port)\n\t\tif err != nil {\n\t\t\treturn nil, err","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/netext/dialer.go#L146-L182","documentation":"Raised by Dialer.findRemote when DNS resolution returns neither an error nor an IP for the requested host — the hostname simply does not exist. It mirrors Go's net.DNS \"no such host\" error shape for hosts configured through k6's network layer.","triggerScenarios":"Thrown at lib/netext/dialer.go:164 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the hostname is spelled correctly in the script","Check DNS resolution from the machine running k6 (e.g. nslookup)","Map the hostname to an IP via the --host (hosts) option if it should be overridden","Ensure the DNS policy in K6_DNS is not blocking the lookup"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}