mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
fix: default-nameserver allow DOT and DOH with host is ip
This commit is contained in:
parent
6548dc90fa
commit
9461bcd44e
|
@ -767,7 +767,10 @@ func parseDNS(rawCfg *RawConfig, hosts *trie.DomainTrie, rules []C.Rule) (*DNS,
|
|||
for _, ns := range dnsCfg.DefaultNameserver {
|
||||
host, _, err := net.SplitHostPort(ns.Addr)
|
||||
if err != nil || net.ParseIP(host) == nil {
|
||||
return nil, errors.New("default nameserver should be pure IP")
|
||||
u, err := url.Parse(ns.Addr)
|
||||
if err != nil || net.ParseIP(u.Host) == nil {
|
||||
return nil, errors.New("default nameserver should be pure IP")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user