Skip to content

Commit

Permalink
Revised Xray Fake DNS.
Browse files Browse the repository at this point in the history
  • Loading branch information
bia-pain-bache committed Oct 24, 2024
1 parent bc479c8 commit edbbc7c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
14 changes: 13 additions & 1 deletion _worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3249,7 +3249,6 @@ async function buildXrayDNS (proxySettings, outboundAddrs, domainToStaticIPs, is
tag: "dns",
};

isFakeDNS && dnsObject.servers.unshift("fakedns");
isOutboundRule && dnsObject.servers.push({
address: localDNS,
domains: outboundRules
Expand All @@ -3268,10 +3267,24 @@ async function buildXrayDNS (proxySettings, outboundAddrs, domainToStaticIPs, is
localDNSServer.expectIPs.push(ip);
}
});

dnsObject.servers.push(localDNSServer);
}

if (isFakeDNS) {
if ((isBypass || isOutboundRule) && !isWorkerLess) {
dnsObject.servers.unshift({
address: "fakedns",
domains: [
...localDNSServer.domains,
...outboundRules
]
});
} else {
dnsObject.servers.unshift("fakedns");
}
}

return dnsObject;
}

Expand Down

0 comments on commit edbbc7c

Please sign in to comment.