XTLS/Xray-core · error
failed to build DNS configuration
Error message
failed to build DNS configuration
What it means
Config.Build wraps a failure of DNSConfig.Build while compiling the "dns" section into the DNS app. The DNS config object is present but invalid (bad server entries, unresolved hosts), so the overall build fails.
Solutions
- Check DNS server address formats and dns config fields
- Fix or remove problematic entries in the dns block
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at infra/conf/xray.go:594 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/ea1e8c697da5e7f4.
Report an issue: GitHub.
Appendix: source
Thrown at infra/conf/xray.go:594
} else {
logConfMsg = serial.ToTypedMessage(DefaultLogConfig())
}
// let logger module be the first App to start,
// so that other modules could print log during initiating
config.App = append([]*serial.TypedMessage{logConfMsg}, config.App...)
if c.RouterConfig != nil {
routerConfig, err := c.RouterConfig.Build()
if err != nil {
return nil, errors.New("failed to build routing configuration").Base(err)
}
config.App = append(config.App, serial.ToTypedMessage(routerConfig))
}
if c.DNSConfig != nil {
dnsApp, err := c.DNSConfig.Build()
if err != nil {
return nil, errors.New("failed to build DNS configuration").Base(err)
}
config.App = append(config.App, serial.ToTypedMessage(dnsApp))
}
if c.Policy != nil {
pc, err := c.Policy.Build()
if err != nil {
return nil, errors.New("failed to build policy configuration").Base(err)
}
config.App = append(config.App, serial.ToTypedMessage(pc))
}
if c.Reverse != nil {
return nil, errors.PrintRemovedFeatureError(`"legacy reverse"`, `"VLESS Reverse Proxy"`)
r, err := c.Reverse.Build()
if err != nil {
return nil, errors.New("failed to build reverse configuration").Base(err)
}View on GitHub (pinned to 7d214f8b09)