// 递归DNS设置 Vue.component("ns-recursion-config-box", { props: ["v-recursion-config"], data: function () { let recursion = this.vRecursionConfig if (recursion == null) { recursion = { isOn: false, hosts: [], allowDomains: [], denyDomains: [], useLocalHosts: false } } if (recursion.hosts == null) { recursion.hosts = [] } if (recursion.allowDomains == null) { recursion.allowDomains = [] } if (recursion.denyDomains == null) { recursion.denyDomains = [] } return { config: recursion, hostIsAdding: false, host: "", updatingHost: null } }, methods: { changeHosts: function (hosts) { this.config.hosts = hosts }, changeAllowDomains: function (domains) { this.config.allowDomains = domains }, changeDenyDomains: function (domains) { this.config.denyDomains = domains }, removeHost: function (index) { this.config.hosts.$remove(index) }, addHost: function () { this.updatingHost = null this.host = "" this.hostIsAdding = !this.hostIsAdding if (this.hostIsAdding) { var that = this setTimeout(function () { let hostRef = that.$refs.hostRef if (hostRef != null) { hostRef.focus() } }, 200) } }, updateHost: function (host) { this.updatingHost = host this.host = host.host this.hostIsAdding = !this.hostIsAdding if (this.hostIsAdding) { var that = this setTimeout(function () { let hostRef = that.$refs.hostRef if (hostRef != null) { hostRef.focus() } }, 200) } }, confirmHost: function () { if (this.host.length == 0) { teaweb.warn("请输入DNS地址") return } // TODO 校验Host // TODO 可以输入端口号 // TODO 可以选择协议 this.hostIsAdding = false if (this.updatingHost == null) { this.config.hosts.push({ host: this.host }) } else { this.updatingHost.host = this.host } }, cancelHost: function () { this.hostIsAdding = false } }, template: `
启用

启用后,如果找不到某个域名的解析记录,则向上一级DNS查找。

从节点本机读取
上级DNS主机

选中后,节点会试图从/etc/resolv.conf文件中读取DNS配置。

上级DNS主机地址 *
{{host.host}}  
 
允许的域名

支持星号通配符,比如*.example.org

不允许的域名

支持星号通配符,比如*.example.org。优先级比允许的域名高。

` })