mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
Add support for default ports nameserver config
This commit is contained in:
parent
1b11d1589b
commit
3c6cd69f50
1 changed files with 10 additions and 0 deletions
|
@ -90,6 +90,16 @@ func createResolver(resolverURL, source string) (*Resolver, bool, error) {
|
||||||
return nil, false, fmt.Errorf("invalid resolver IP")
|
return nil, false, fmt.Errorf("invalid resolver IP")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add default port for scheme if it is missing.
|
||||||
|
if u.Port() == "" {
|
||||||
|
switch u.Scheme {
|
||||||
|
case ServerTypeDNS, ServerTypeTCP:
|
||||||
|
u.Host += ":53"
|
||||||
|
case ServerTypeDoT:
|
||||||
|
u.Host += ":853"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
scope := netutils.ClassifyIP(ip)
|
scope := netutils.ClassifyIP(ip)
|
||||||
if scope == netutils.HostLocal {
|
if scope == netutils.HostLocal {
|
||||||
return nil, true, nil // skip
|
return nil, true, nil // skip
|
||||||
|
|
Loading…
Add table
Reference in a new issue