fix: default-nameserver allow DOT and DOH with host is ip
This commit is contained in:
parent
0d1e4405da
commit
3c6be05ec9
1 changed files with 4 additions and 1 deletions
|
@ -767,9 +767,12 @@ 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 {
|
||||
u, err := url.Parse(ns.Addr)
|
||||
if err != nil || net.ParseIP(u.Host) == nil {
|
||||
return nil, errors.New("default nameserver should be pure IP")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.EnhancedMode == C.DNSFakeIP {
|
||||
_, ipnet, err := net.ParseCIDR(cfg.FakeIPRange)
|
||||
|
|
Loading…
Reference in a new issue