mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #5853] [Bug]: WireGuard Outbound: DNS queries use system DNS instead of being resolved inside the WireGuard tunnel / خروجی WireGuard: درخواستهای DNS از DNS سیستم استفاده میکنند و داخل تونل Wir… #4066
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4066
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @montiego on GitHub (Jul 7, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5853
Describe the bug
English
When using WireGuard as an outbound, DNS queries are currently forwarded to the configured DNS server instead of being resolved directly through the WireGuard tunnel.
It would be useful to have an option in the WireGuard outbound settings to specify DNS servers that are used inside the WireGuard tunnel, similar to the
DNSoption in a standard WireGuard configuration.This would ensure that DNS requests are sent through the WireGuard interface itself, preventing DNS leaks and improving privacy and compatibility in some network environments.
فارسی
هنگام استفاده از WireGuard به عنوان خروجی (Outbound)، درخواستهای DNS در حال حاضر به DNS سرور تنظیمشده در هسته ارسال میشوند و مستقیماً داخل تونل WireGuard حل نمیشوند.
پیشنهاد میشود در تنظیمات خروجی WireGuard گزینهای برای تعیین DNS سرور مخصوص خود WireGuard اضافه شود؛ مشابه گزینه
DNSدر فایل پیکربندی استاندارد WireGuard.با این قابلیت، درخواستهای DNS از داخل رابط WireGuard ارسال و حل میشوند که میتواند از نشت DNS جلوگیری کرده و حریم خصوصی و سازگاری با برخی شبکهها را بهبود دهد.
How to reproduce the problem
English
When using WireGuard as an outbound, DNS queries are currently forwarded to the configured DNS server instead of being resolved directly through the WireGuard tunnel.
It would be useful to have an option in the WireGuard outbound settings to specify DNS servers that are used inside the WireGuard tunnel, similar to the
DNSoption in a standard WireGuard configuration.This would ensure that DNS requests are sent through the WireGuard interface itself, preventing DNS leaks and improving privacy and compatibility in some network environments.
فارسی
هنگام استفاده از WireGuard به عنوان خروجی (Outbound)، درخواستهای DNS در حال حاضر به DNS سرور تنظیمشده در هسته ارسال میشوند و مستقیماً داخل تونل WireGuard حل نمیشوند.
پیشنهاد میشود در تنظیمات خروجی WireGuard گزینهای برای تعیین DNS سرور مخصوص خود WireGuard اضافه شود؛ مشابه گزینه
DNSدر فایل پیکربندی استاندارد WireGuard.با این قابلیت، درخواستهای DNS از داخل رابط WireGuard ارسال و حل میشوند که میتواند از نشت DNS جلوگیری کرده و حریم خصوصی و سازگاری با برخی شبکهها را بهبود دهد.
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.4.2
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
ubuntu24
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jul 7, 2026):
This is confirmed as a missing feature, not an existing setting that is misbehaving.
What I checked:
frontend/src/schemas/protocols/outbound/wireguard.ts) only definesaddress,secretKey/pubKey,domainStrategy,mtu,noKernelTun,reserved, and per-peerpublicKey/preSharedKey/allowedIPs/endpoint/keepAlive. There is nodnsfield, and the outbound form (frontend/src/pages/xray/outbounds/protocols/wireguard.tsx) does not expose one either — so there is currently no panel option equivalent to theDNS =line in a standardwg-quickconfig.internal/web/service/xray.go), so this isn't a case of the server stripping a field you can already set — the panel's form/schema simply doesn't offer it. Even if you hand-edited the raw outbound JSON to add adnskey, it would be dropped the next time the outbound is saved through the form, since the Zod schema only keeps the fields listed above.Possible existing workaround (untested by me, worth trying): the panel's DNS settings support a per-server
tag(frontend/src/schemas/dns.ts), and routing rules support matching oninboundTagwith anoutboundTag(frontend/src/schemas/routing.ts). In Xray-core, a tagged DNS server's queries can be matched by a routing rule via that tag and redirected to a specific outbound. If that holds for your Xray-core version, you could add a DNS server tagged e.g.wg-dnsin the DNS settings and a routing ruleinboundTag: ["wg-dns"] -> outboundTag: "<your-wireguard-outbound-tag>"to force that resolver's queries through the tunnel, without a dedicated per-outbound DNS field. Please verify this actually resolves through the tunnel in your setup before relying on it, since I have not tested it against a running instance.Labeling this as an enhancement — a first-class
DNSoption inside the WireGuard outbound settings (mirrored in the form, schema, and any relevant locale strings) would still be the more direct fix.این مورد یک قابلیت گمشده است، نه یک تنظیم موجود که بهدرستی کار نمیکند. طبق بررسی کد فعلی، تنظیمات خروجی WireGuard در پنل فیلدی برای DNS ندارد. بهعنوان راهحل موقت (که خودم تست نکردهام)، میتوانید در تنظیمات DNS یک سرور با
tagمشخص اضافه کنید و در Routing Rules باinboundTagهمان تگ، ترافیک را بهoutboundTagخروجی WireGuard هدایت کنید.This reply was generated automatically and a maintainer may follow up.
[GH-ISSUE #5853] [Bug]: WireGuard Outbound: DNS queries use system DNS instead of being resolved inside the WireGuard tunnel / خروجی WireGuard: درخواستهای DNS از DNS سیستم استفاده میکنند و داخل تونل Wir…to [GH-ISSUE #5853] [Bug]: WireGuard Outbound: DNS queries use system DNS instead of being resolved inside the WireGuard tunnel / خروجی WireGuard: درخواستهای DNS از DNS سیستم استفاده میکنند و داخل تونل Wir…