diff --git a/web/html/xui/dns_modal.html b/web/html/xui/dns_modal.html
index 2c0a6beb..02ea7925 100644
--- a/web/html/xui/dns_modal.html
+++ b/web/html/xui/dns_modal.html
@@ -3,6 +3,17 @@
:mask-closable="false" :ok-text="dnsModal.okText" cancel-text='{{ i18n "close" }}'
:class="themeSwitcher.currentTheme">
+
+
+
+
+ {{ i18n "pages.xray.dns.idDesc" }}
+
+ ID
+
+
+
+
@@ -43,6 +54,7 @@
isEdit: false,
confirm: null,
dnsServer: {
+ id: '',
address: "localhost",
domains: [],
expectIPs: [],
@@ -54,7 +66,9 @@
expectIPs = dnsModal.dnsServer.expectIPs.filter(ip => ip.length > 0);
dnsModal.dnsServer.domains = domains;
dnsModal.dnsServer.expectIPs = expectIPs;
- newDnsServer = (domains.length > 0 || expectIPs.length > 0) ? dnsModal.dnsServer : dnsModal.dnsServer.address;
+ if (!dnsModal.dnsServer.id) delete dnsModal.dnsServer.id;
+ // a bare address string cannot carry the id a DNS script looks servers up by
+ newDnsServer = (domains.length > 0 || expectIPs.length > 0 || dnsModal.dnsServer.id) ? dnsModal.dnsServer : dnsModal.dnsServer.address;
ObjectUtil.execute(dnsModal.confirm, newDnsServer);
},
@@ -71,9 +85,10 @@
this.visible = true;
if (isEdit) {
if (typeof dnsServer == 'object') {
- this.dnsServer = dnsServer;
+ this.dnsServer = { id: '', domains: [], expectIPs: [], ...dnsServer };
} else {
this.dnsServer = {
+ id: '',
address: dnsServer ?? "",
domains: [],
expectIPs: [],
@@ -83,6 +98,7 @@
}
} else {
this.dnsServer = {
+ id: '',
address: "localhost",
domains: [],
expectIPs: [],
diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html
index e03ca927..f98b0a1c 100644
--- a/web/html/xui/xray.html
+++ b/web/html/xui/xray.html
@@ -150,6 +150,7 @@
+
@@ -327,6 +328,7 @@
+
DNS
{{ i18n "pages.xray.dns.add" }}