{"record":{"id":"683e1fa9bf7e5791","repo":"fatedier/frp","slug":"custom-domain-s-should-not-belong-to-subdomain","errorCode":null,"errorMessage":"custom domain [%s] should not belong to subdomain host [%s]","messagePattern":"custom domain \\[(.+?)\\] should not belong to subdomain host \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/v1/validation/proxy.go","lineNumber":87,"sourceCode":"\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc validateDomainConfigForClient(c *v1.DomainConfig) error {\n\tif c.SubDomain == \"\" && len(c.CustomDomains) == 0 {\n\t\treturn errors.New(\"subdomain and custom domains should not be both empty\")\n\t}\n\treturn nil\n}\n\nfunc validateDomainConfigForServer(c *v1.DomainConfig, s *v1.ServerConfig) error {\n\tsubDomainHost := strings.ToLower(s.SubDomainHost)\n\tfor _, domain := range c.CustomDomains {\n\t\tcanonicalDomain := strings.ToLower(domain)\n\t\tif subDomainHost != \"\" && len(strings.Split(subDomainHost, \".\")) < len(strings.Split(canonicalDomain, \".\")) {\n\t\t\tif strings.HasSuffix(canonicalDomain, \".\"+subDomainHost) {\n\t\t\t\treturn fmt.Errorf(\"custom domain [%s] should not belong to subdomain host [%s]\", domain, s.SubDomainHost)\n\t\t\t}\n\t\t}\n\t}\n\n\tif c.SubDomain != \"\" {\n\t\tif s.SubDomainHost == \"\" {\n\t\t\treturn errors.New(\"subdomain is not supported because this feature is not enabled in server\")\n\t\t}\n\n\t\tif strings.Contains(c.SubDomain, \".\") || strings.Contains(c.SubDomain, \"*\") {\n\t\t\treturn errors.New(\"'.' and '*' are not supported in subdomain\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc ValidateProxyConfigurerForClient(c v1.ProxyConfigurer) error {\n\tbase := c.GetBaseConfig()","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/v1/validation/proxy.go#L69-L105","documentation":"Error \"custom domain [%s] should not belong to subdomain host [%s]\" thrown in fatedier/frp.","triggerScenarios":"Raised by validateDomainConfigForClient in pkg/config/v1/validation/proxy.go when a customDomain entry falls inside the subdomainHost domain, which would conflict with generated subdomains.","commonSituations":"customDomains contains a name under the subdomainHost domain (e.g. subdomainHost is example.com and customDomains includes foo.example.com). Fix by removing the overlapping custom domain or choosing a different subdomainHost.","solutions":["Remove the custom domain that ends with the server subDomainHost, or use subdomain instead of customDomains for that name.","Ask the server administrator for the configured subDomainHost and select a custom domain outside of it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}