diff --git a/db/ConfigBuilder.cpp b/db/ConfigBuilder.cpp index dd33f2ad4..a94c846b8 100644 --- a/db/ConfigBuilder.cpp +++ b/db/ConfigBuilder.cpp @@ -275,6 +275,7 @@ namespace NekoRay { } dnsServers += QJsonObject{ {"address", directDnsAddress}, + {"fallbackStrategy", "disabled"}, {"domains", QList2QJsonArray(status->domainListDNSDirect)}, }; diff --git a/go/cmd/nekoray_core/core_ray.go b/go/cmd/nekoray_core/core_ray.go index 32e9f5015..dbf368c34 100644 --- a/go/cmd/nekoray_core/core_ray.go +++ b/go/cmd/nekoray_core/core_ray.go @@ -10,7 +10,9 @@ import ( "net/http" "time" + "github.com/sirupsen/logrus" v2rayNet "github.com/v2fly/v2ray-core/v5/common/net" + "github.com/v2fly/v2ray-core/v5/features/dns" "github.com/v2fly/v2ray-core/v5/features/dns/localdns" ) @@ -25,7 +27,14 @@ func setupCore() { // localdns setup resolver_def := &net.Resolver{PreferGo: false} resolver_go := &net.Resolver{PreferGo: true} - localdns.SetLookupFunc(func(network string, host string) ([]net.IP, error) { + localdns.SetLookupFunc(func(network string, host string) (ips []net.IP, err error) { + // fix old sekai + defer func() { + if len(ips) == 0 { + logrus.Println("LookupIP error:", err) + err = dns.ErrEmptyResponse + } + }() // Normal mode use system resolver (go bug) if getNekorayTunIndex() == 0 { return resolver_def.LookupIP(context.Background(), network, host)