{"record":{"id":"8312a875e6e1f74e","repo":"jeessy2/ddns-go","slug":"domain-s-not-found","errorCode":null,"errorMessage":"domain %s not found","messagePattern":"domain (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dns/hipmdnsmgr.go","lineNumber":336,"sourceCode":"\t\t\tif d.Name == domainName {\n\t\t\t\treturn d.ID, nil\n\t\t\t}\n\t\t}\n\n\t\t// Check if we've reached the end\n\t\tif len(pageDomains) < pageSize || (total > 0 && currentPage*pageSize >= total) {\n\t\t\tbreak\n\t\t}\n\n\t\tcurrentPage++\n\n\t\t// Safety limit: stop after 10 pages (1000 domains)\n\t\tif currentPage > 10 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn 0, fmt.Errorf(\"domain %s not found\", domainName)\n}\n\n// getRecord Get DNS record\n// Paginate through all records to find the target\nfunc (h *HiPMDnsMgr) getRecord(baseURL, apiToken string, domainID int, subDomain, recordType string) (*DnsMgrRecord, error) {\n\tconst pageSize = 100\n\tcurrentPage := 1\n\n\tfor {\n\t\tpath := fmt.Sprintf(\"/domains/%d/records?page=%d&pageSize=%d&subdomain=%s&type=%s\",\n\t\t\tdomainID, currentPage, pageSize, subDomain, recordType)\n\n\t\tapiResp, err := h.request(baseURL, apiToken, \"GET\", path, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"paginated record query failed at page %d: %w\", currentPage, err)\n\t\t}\n\n\t\tif apiResp.Code != 0 {","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/jeessy2/ddns-go/blob/5874c2e6667c69357ab95079421131104bd3fcae/dns/hipmdnsmgr.go#L318-L354","documentation":"After scanning up to 10 pages (1000 domains) the library never found a domain whose name equals domainName, so getDomainID returns 0 with this error. It is a not-found sentinel for the domain being updated via updateRecord.","triggerScenarios":"domainName passed to getDomainID does not match any domain returned by the provider's paginated domain list (case/typo mismatch, domain belongs to another account, or provider returns only the first 1000 domains).","commonSituations":"Typo in the configured FQDN, domain registered under a different provider account, domain recently deleted/expired, or more than 1000 domains in the account so the safety limit truncates the scan before reaching it.","solutions":["Check the exact domain name spelling in your configuration against the provider dashboard","Confirm the domain exists under the account owning the API token","If the account has >1000 domains, raise the page limit or query the specific domain endpoint directly","Re-check the domain registration/expiry status with the provider"],"exampleFix":"// before\nid, err := mgr.getDomainID(baseURL, token, \"example.con\")\n// after\nid, err := mgr.getDomainID(baseURL, token, \"example.com\") // verify name on provider dashboard","handlingStrategy":"validation","validationCode":"// Go: confirm domain exists before calling updateRecord\nvar found bool\nfor _, d := range listAllDomains(baseURL, token) {\n    if d.Name == domainName { found = true; break }\n}\nif !found { return fmt.Errorf(\"domain %q not in account; check spelling/account\", domainName) }","typeGuard":"func domainExists(domains []DnsMgrDomain, name string) bool {\n    for _, d := range domains {\n        if d.Name == name { return true }\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Copy domain names exactly from the provider dashboard, no typos","Confirm the token's account actually owns the domain","Watch for the 10-page/1000-domain safety limit with large portfolios","Alert on domain expiry so it isn't silently deleted"],"tags":["dns","not-found","configuration","pagination"],"backgroundTag":"resource-not-found","analyzedSha":"5874c2e6667c69357ab95079421131104bd3fcae","analyzedAt":"2026-09-03T15:41:16.799Z","contentChangedAt":"2026-09-03T15:41:16.799Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}