Skip to content

Commit

Permalink
fix: when no dns found for skydns
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Aug 3, 2024
1 parent d08c5d8 commit 56ceaa9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro
}

options.DNS = &option.DNSOptions{
StaticIPs: map[string][]string{
"sky.rethinkdns.com": getIPs([]string{"www.speedtest.net", "sky.rethinkdns.com"}),
},
StaticIPs: map[string][]string{},
DNSClientOptions: option.DNSClientOptions{
IndependentCache: opt.IndependentDNSCache,
},
Expand Down Expand Up @@ -142,7 +140,10 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro
},
},
}

sky_rethinkdns := getIPs([]string{"www.speedtest.net", "sky.rethinkdns.com"})
if len(sky_rethinkdns) > 0 {
options.DNS.StaticIPs["sky.rethinkdns.com"] = sky_rethinkdns
}
var inboundDomainStrategy option.DomainStrategy
if !opt.ResolveDestination {
inboundDomainStrategy = option.DomainStrategy(dns.DomainStrategyAsIS)
Expand Down Expand Up @@ -464,8 +465,8 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro
routeRuleLocalDomain := option.Rule{
Type: C.RuleTypeDefault,
DefaultOptions: option.DefaultRule{
Domain: []string{"." + opt.Region},
Outbound: OutboundDirectTag,
DomainSuffix: []string{"." + opt.Region},
Outbound: OutboundDirectTag,
},
}
options.Route.Rules = append([]option.Rule{routeRuleLocalDomain}, options.Route.Rules...)
Expand Down

0 comments on commit 56ceaa9

Please sign in to comment.