1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-18 03:29:12 -04:00

Add disableFallbackIfMatch dns option

This commit is contained in:
世界
2021-09-13 10:35:34 +08:00
committed by Shelikhoo
parent 9ee66f7efe
commit f383f896ed
5 changed files with 98 additions and 67 deletions

View File

@@ -140,14 +140,14 @@ var typeMap = map[routercommon.Domain_Type]dns.DomainMatchingType{
// DNSConfig is a JSON serializable object for dns.Config.
type DNSConfig struct {
Servers []*NameServerConfig `json:"servers"`
Hosts map[string]*HostAddress `json:"hosts"`
ClientIP *cfgcommon.Address `json:"clientIp"`
Tag string `json:"tag"`
QueryStrategy string `json:"queryStrategy"`
DisableCache bool `json:"disableCache"`
DisableFallback bool `json:"disableFallback"`
Servers []*NameServerConfig `json:"servers"`
Hosts map[string]*HostAddress `json:"hosts"`
ClientIP *cfgcommon.Address `json:"clientIp"`
Tag string `json:"tag"`
QueryStrategy string `json:"queryStrategy"`
DisableCache bool `json:"disableCache"`
DisableFallback bool `json:"disableFallback"`
DisableFallbackIfMatch bool `json:"disableFallbackIfMatch"`
cfgctx context.Context
}
@@ -224,9 +224,10 @@ func (c *DNSConfig) Build() (*dns.Config, error) {
geoLoader := cfgEnv.GetGeoLoader()
config := &dns.Config{
Tag: c.Tag,
DisableCache: c.DisableCache,
DisableFallback: c.DisableFallback,
Tag: c.Tag,
DisableCache: c.DisableCache,
DisableFallback: c.DisableFallback,
DisableFallbackIfMatch: c.DisableFallbackIfMatch,
}
if c.ClientIP != nil {