SpoofDPI
SpoofDPI copied to clipboard
Option to disable built-in DNS resolver & use system DNS
For users that already use encrypted DNS resolver like dnscrypt-proxy & stubby
OMG! Yes, I also was about to make the same feature request!
is this like the same request as #32 ?
is this like the same request as #32 ?
I think it's different, #32 allows you to specify DoH's resolver template while this request allows you to completely disable DoH & use system's DNS
so, do you guys locally have your own dns severs ?
should i add an option like --use-system-proxy or what kinda option would it be?
should i add an option like --use-system-proxy or what kinda option would it be?
--use-system-dns would be good for this feature
i meant it either. just mistyped
okay, then let me take a look on it
A simple hack in the meantime. Replace the dns.go
file contents in the doh
folder with this:
package doh
import (
dns "github.com/Focinfi/go-dns-resolver"
"errors"
"regexp"
)
func Init() {
dns.Config.SetTimeout(uint(5))
dns.Config.RetryTimes = uint(2)
}
func Lookup(domain string) (string, error) {
ipRegex := "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
if r, _ := regexp.MatchString(ipRegex, domain); r {
return domain, nil
}
if results, err := dns.Exchange(domain, "127.0.0.1:53", dns.TypeA); err == nil {
if len(results) < 1 {
return "", errors.New(" couldn't resolve the domain")
}
return results[0].Content, nil
} else {
return "", err
}
}
N.B. change '127.0.0.1:53' to point to your local DNS server.
How can I disable DOH and use a local DNS server on port 53?
Please add an option for this. I too use dnscrpyt-proxy with a custom configuration and blocklist/whitelist and I can't get this and it to work together. Something like a --use-system-dns
switch would be great.