add direct-nameserver setting
Some checks are pending
Build / windows (arm64) (push) Waiting to run
Build / windows (ia32) (push) Waiting to run
Build / windows (x64) (push) Waiting to run
Build / windows7 (ia32) (push) Waiting to run
Build / windows7 (x64) (push) Waiting to run
Build / linux (arm64) (push) Waiting to run
Build / linux (x64) (push) Waiting to run
Build / macos (arm64) (push) Waiting to run
Build / macos (x64) (push) Waiting to run
Build / macos10 (arm64) (push) Waiting to run
Build / macos10 (x64) (push) Waiting to run
Build / artifact-windows (push) Blocked by required conditions
Build / artifact-windows7 (push) Blocked by required conditions
Build / artifact-macos (push) Blocked by required conditions
Build / artifact-macos10 (push) Blocked by required conditions
Build / artifact-linux (push) Blocked by required conditions
Build / updater (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-bin) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron) (push) Blocked by required conditions
Build / aur-release-updater (mihomo-party-electron-bin) (push) Blocked by required conditions
Build / aur-git-updater (push) Waiting to run
Build / Update WinGet Package (push) Blocked by required conditions
Build / Update Homebrew cask (push) Blocked by required conditions

This commit is contained in:
xishang0128 2024-11-06 21:21:31 +08:00
parent c043281b9f
commit 700c5d26b9
3 changed files with 22 additions and 4 deletions

View File

@ -74,7 +74,8 @@ export const defaultControledMihomoConfig: Partial<IMihomoConfig> = {
'use-hosts': false,
'use-system-hosts': false,
nameserver: ['https://120.53.53.53/dns-query', 'https://223.5.5.5/dns-query'],
'proxy-server-nameserver': ['https://120.53.53.53/dns-query', 'https://223.5.5.5/dns-query']
'proxy-server-nameserver': ['https://120.53.53.53/dns-query', 'https://223.5.5.5/dns-query'],
'direct-nameserver': []
},
sniffer: {
enable: true,

View File

@ -32,7 +32,8 @@ const DNS: React.FC = () => {
'proxy-server-nameserver': proxyServerNameserver = [
'https://120.53.53.53/dns-query',
'https://223.5.5.5/dns-query'
]
],
'direct-nameserver': directNameserver = []
} = dns || {}
const [changed, setChanged] = useState(false)
const [values, originSetValues] = useState({
@ -45,6 +46,7 @@ const DNS: React.FC = () => {
respectRules,
nameserver,
proxyServerNameserver,
directNameserver,
useNameserverPolicy,
nameserverPolicy: Object.entries(nameserverPolicy || {}).map(([domain, value]) => ({
domain,
@ -149,6 +151,7 @@ const DNS: React.FC = () => {
'respect-rules': values.respectRules,
nameserver: values.nameserver,
'proxy-server-nameserver': values.proxyServerNameserver,
'direct-nameserver': values.directNameserver,
fallback: [],
'fallback-filter': {}
}
@ -209,7 +212,7 @@ const DNS: React.FC = () => {
}}
/>
</SettingItem>
<SettingItem title="连接遵守规则" divider>
<SettingItem title="遵守规则" divider>
<Switch
size="sm"
isSelected={values.respectRules}
@ -220,7 +223,7 @@ const DNS: React.FC = () => {
</SettingItem>
<div className="flex flex-col items-stretch">
<h3></h3>
<h3></h3>
{renderListInputs('proxyServerNameserver', '例tls://223.5.5.5')}
</div>
<Divider className="my-2" />
@ -229,6 +232,11 @@ const DNS: React.FC = () => {
{renderListInputs('nameserver', '例tls://223.5.5.5')}
</div>
<Divider className="my-2" />
<div className="flex flex-col items-stretch">
<h3> DNS </h3>
{renderListInputs('directNameserver', '例tls://223.5.5.5')}
</div>
<Divider className="my-2" />
<SettingItem title="覆盖DNS策略" divider>
<Switch
size="sm"

View File

@ -27,6 +27,7 @@ type MihomoProxyType =
type TunStack = 'gvisor' | 'mixed' | 'system'
type FindProcessMode = 'off' | 'strict' | 'always'
type DnsMode = 'normal' | 'fake-ip' | 'redir-host'
type FilterMode = 'blacklist' | 'whitelist'
type NetworkInterfaceInfo = os.NetworkInterfaceInfo
interface IAppVersion {
@ -311,18 +312,26 @@ interface IMihomoTunConfig {
}
interface IMihomoDNSConfig {
enable?: boolean
listen?: string
ipv6?: boolean
'ipv6-timeout'?: number
'prefer-h3'?: boolean
'enhanced-mode'?: DnsMode
'fake-ip-range'?: string
'fake-ip-filter'?: string[]
'fake-ip-filter-mode'?: FilterMode
'use-hosts'?: boolean
'use-system-hosts'?: boolean
'respect-rules'?: boolean
'default-nameserver'?: string[]
nameserver?: string[]
fallback?: string[]
'fallback-filter'?: { [key: string]: boolean | string | string[] }
'proxy-server-nameserver'?: string[]
'direct-nameserver'?: string[]
'direct-nameserver-follow-policy'?: boolean
'nameserver-policy'?: { [key: string]: string | string[] }
'cache-algorithm'?: string
}
interface IMihomoSnifferConfig {