{"record":{"id":"847700b34c9d6d93","repo":"v2ray/v2ray-core","slug":"unknown-domain-type","errorCode":null,"errorMessage":"unknown domain type","messagePattern":"unknown domain type","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/dns.go","lineNumber":55,"sourceCode":"\t\tc.ExpectIPs = advanced.ExpectIPs\n\t\treturn nil\n\t}\n\n\treturn newError(\"failed to parse name server: \", string(data))\n}\n\nfunc toDomainMatchingType(t router.Domain_Type) dns.DomainMatchingType {\n\tswitch t {\n\tcase router.Domain_Domain:\n\t\treturn dns.DomainMatchingType_Subdomain\n\tcase router.Domain_Full:\n\t\treturn dns.DomainMatchingType_Full\n\tcase router.Domain_Plain:\n\t\treturn dns.DomainMatchingType_Keyword\n\tcase router.Domain_Regex:\n\t\treturn dns.DomainMatchingType_Regex\n\tdefault:\n\t\tpanic(\"unknown domain type\")\n\t}\n}\n\nfunc (c *NameServerConfig) Build() (*dns.NameServer, error) {\n\tif c.Address == nil {\n\t\treturn nil, newError(\"NameServer address is not specified.\")\n\t}\n\n\tvar domains []*dns.NameServer_PriorityDomain\n\tvar originalRules []*dns.NameServer_OriginalRule\n\n\tfor _, rule := range c.Domains {\n\t\tparsedDomain, err := parseDomainRule(rule)\n\t\tif err != nil {\n\t\t\treturn nil, newError(\"invalid domain rule: \", rule).Base(err)\n\t\t}\n\n\t\tfor _, pd := range parsedDomain {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/v2ray/v2ray-core/blob/d80440f3d57b45c829dbf513306f7adf9a0f3f76/infra/conf/dns.go#L37-L73","documentation":"Error \"unknown domain type\" thrown in v2ray/v2ray-core.","triggerScenarios":"Thrown at infra/conf/dns.go:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the domain rule syntax in the DNS/routing config: prefix with \"domain:\" (subdomain), \"full:\" (exact), \"keyword:\" (substring), or \"regexp:\" (regex) so the parsed domain type is one of the supported types.","Remove or correct malformed domain entries in the name server's \"domains\" list that do not match any known rule type.","If rules are generated programmatically, ensure the generator emits a recognized router.Domain_Type before it reaches toDomainMatchingType."],"exampleFix":"\"domains\":[\"domain:example.com\",\"full:www.example.com\",\"keyword:cdn\",\"regexp:^api\\\\..*\\\\.com$\"]","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d80440f3d57b45c829dbf513306f7adf9a0f3f76","analyzedAt":"2026-08-15T10:08:13.480Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}