{"record":{"id":"8932bebd682e4eee","repo":"fatedier/frp","slug":"and-are-not-supported-in-subdomain","errorCode":null,"errorMessage":"'.' and '*' are not supported in subdomain","messagePattern":"'\\.' and '\\*' are not supported in subdomain","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/v1/validation/proxy.go","lineNumber":98,"sourceCode":"\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()\n\tif err := validateProxyBaseConfigForClient(base); err != nil {\n\t\treturn err\n\t}\n\n\tswitch v := c.(type) {\n\tcase *v1.TCPProxyConfig:\n\t\treturn validateTCPProxyConfigForClient(v)\n\tcase *v1.UDPProxyConfig:\n\t\treturn validateUDPProxyConfigForClient(v)\n\tcase *v1.TCPMuxProxyConfig:\n\t\treturn validateTCPMuxProxyConfigForClient(v)","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/v1/validation/proxy.go#L80-L116","documentation":"Server-side validation error from validateDomainConfigForServer: the proxy's subdomain value contains a dot or an asterisk. Subdomains are single labels appended to subDomainHost (e.g. \"web\" -> web.frps.example.com); dots would create multi-level names that break the wildcard certificate/host mapping, and wildcards are not supported at all. Rejected during frps-side proxy registration validation.","triggerScenarios":"An frpc proxy registers with subdomain = \"a.b\", subdomain = \"*.web\", or any value containing '.' or '*' while the server has subDomainHost enabled.","commonSituations":"Trying to get a nested hostname like dev.web.example.com by writing subdomain = \"dev.web\" instead of using customDomains; attempting wildcard routing (*.example.com) via subdomain, which requires a wildcard customDomain and matching server cert instead; migrating from another tunnel tool where deep subdomain strings were allowed.","solutions":["Use a single label without dots or wildcards: subdomain = \"web\" (yields web.<subDomainHost>).","For deeper hostnames (e.g. dev.web.example.com), use customDomains = [\"dev.web.example.com\"] with DNS pointing at frps.","For wildcard access, serve customDomains = [\"*.web.example.com\"] and configure a wildcard TLS certificate on frps (vhost https)."],"exampleFix":"# before\n[[proxies]]\nname = \"web\"\ntype = \"http\"\nsubdomain = \"dev.web\"\n\n# after\n[[proxies]]\nname = \"web\"\ntype = \"http\"\ncustomDomains = [\"dev.web.example.com\"]","handlingStrategy":"validation","validationCode":"func validSubdomainLabel(s string) bool {\n    return s != \"\" && !strings.ContainsAny(s, \".*\")\n}\nif !validSubdomainLabel(p.SubDomain) {\n    return fmt.Errorf(\"subdomain %q must be a single label without '.' or '*'\", p.SubDomain)\n}","typeGuard":"func subdomainIsSingleLabel(s string) bool {\n    return !strings.Contains(s, \".\") && !strings.Contains(s, \"*\")\n}","tryCatchPattern":"if err := validation.ValidateProxyConfigurerForServer(p, serverCfg); err != nil {\n    if strings.Contains(err.Error(), \"'.' and '*' are not supported in subdomain\") {\n        // switch to customDomains for multi-level or wildcard hostnames\n    }\n    return err\n}","preventionTips":["Treat subdomain as a single DNS label (letters, digits, hyphen).","Use customDomains for nested or wildcard hostnames.","For wildcards, configure a wildcard certificate on frps vhost-https."],"tags":["config","proxy","subdomain","validation","frps","routing"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}