mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-12-14 18:51:34 +03:00
Pull request: aghnet: imp windows nslookup
Updates #3375. Squashed commit of the following: commit a98f376a3c8253b873cadb992b42174fb3c1c584 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Aug 31 15:06:03 2021 +0300 aghnet: imp windows nslookup
This commit is contained in:
parent
bb4cd312c2
commit
2365ddd2f2
@ -99,7 +99,13 @@ func scanAddrs(s *bufio.Scanner) (addrs []string) {
|
||||
// local resolvers addresses on Windows. We execute the external command for
|
||||
// now that is not the most accurate way.
|
||||
func (sr *systemResolvers) getAddrs() (addrs []string, err error) {
|
||||
cmd := exec.Command("nslookup")
|
||||
var cmdPath string
|
||||
cmdPath, err = exec.LookPath("nslookup.exe")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("looking up cmd path: %w", err)
|
||||
}
|
||||
|
||||
cmd := exec.Command(cmdPath)
|
||||
|
||||
var stdin io.WriteCloser
|
||||
stdin, err = cmd.StdinPipe()
|
||||
|
Loading…
Reference in New Issue
Block a user