I need to get the DNS info, which can be found under ipconfig /all but when I try it using
SETLOCAL
(
FOR /f "tokens=1*delims=:" %%b IN ('ipconfig /all') DO (
FOR /f %%t IN ("%%b") DO (
If /i "%%t"=="DNS" ECHO %%c&GOTO done
)
)
)> out.txt
it gives me the DNS suffix. Any suggestions on how I might actually get DNS servers? If I try with
If /i "%%t"=="DNS" ECHO %%c&GOTO done
then I end up with no info at all. I'm using a batch file and cmd
question from:https://stackoverflow.com/questions/65893346/parsing-dns-info-to-txt-file