/** * DNS configuration for Xray-Core. * * @see https://xtls.github.io/en/config/dns.html */ export interface DNSConfig { /** DNS server list. Each entry can be a string address or a detailed NameServerConfig. */ servers?: (string | NameServerConfig)[]; /** Static hosts mapping. Key is domain, value is IP address(es) or domain. */ hosts?: Record; /** Client IP for EDNS Client Subnet. */ clientIp?: string; /** Tag for the DNS inbound. Used for routing DNS queries. */ tag?: string; /** Query strategy for IP version preference. */ queryStrategy?: DNSQueryStrategy; /** Disable DNS response caching. */ disableCache?: boolean; /** Serve stale (expired) cache entries when upstream fails. */ serveStale?: boolean; /** Maximum TTL in seconds for serving expired cache entries. */ serveExpiredTTL?: number; /** Disable fallback to other DNS servers on failure. */ disableFallback?: boolean; /** Disable fallback if a domain matches the current server's domain list. */ disableFallbackIfMatch?: boolean; /** Enable parallel queries to all DNS servers simultaneously. */ enableParallelQuery?: boolean; /** Use system /etc/hosts file. */ useSystemHosts?: boolean; } export interface NameServerConfig { /** DNS server address (e.g. "8.8.8.8", "https+local://dns.google/dns-query", "localhost", "fakedns"). */ address?: string; /** Client IP for EDNS Client Subnet for this server. */ clientIp?: string; /** Port for this DNS server (default: 53). */ port?: number; /** Skip this server for fallback queries. */ skipFallback?: boolean; /** Domain list this server is responsible for. Supports domain matching syntax. */ domains?: string[]; /** Expected IPs. Results not matching will be discarded (used for DNS filtering). */ expectedIPs?: string[]; /** Alias for expectedIPs (legacy). */ expectIPs?: string[]; /** Unexpected IPs. Results matching these will be discarded. */ unexpectedIPs?: string[]; /** Override query strategy for this server. */ queryStrategy?: DNSQueryStrategy; /** Tag for routing DNS queries from this server. */ tag?: string; /** Timeout in milliseconds for this server. */ timeoutMs?: number; /** Override global disableCache for this server. */ disableCache?: boolean; /** Override global serveStale for this server. */ serveStale?: boolean; /** Override global serveExpiredTTL for this server. */ serveExpiredTTL?: number; /** Mark this as the final query server. No further fallback after this. */ finalQuery?: boolean; } export type DNSQueryStrategy = 'UseIP' | 'UseIPv4' | 'UseIPv6' | 'UseIPv4v6' | 'UseIPv6v4'; //# sourceMappingURL=dns.d.ts.map