Running dnscmd command

Hi all,

I have been trying to run dnscmd command for different DNS config changes and action doesnt seem to work.

waithidden cmd.exe /c “C:\Windows\system32\dnscmd.exe /config /SecureResponses 0” – not working
waithidden cmd.exe /c ‘C:\Windows\system32\dnscmd.exe /config /SecureResponses 0’ – not working
waithidden cmd.exe /c dnscmd /config /SecureResponses 0 – not working
waithidden cmd.exe /c “dnscmd /config /SecureResponses 0” - not working

waithidden cmd.exe /C “C:\Windows\system32\dnscmd /info /SecureResponses > C:\windows\temp\dnscmd.txt 2>&1” – giving the below output

“‘C:\Windows\system32\dnscmd’ is not recognized as an internal or external command,
operable program or batch file.”

waithidden {pathname of system x32 folder}\cmd.exe /C {pathname of system x32 folder}\dnscmd.exe /info /SecureResponses >> C:\windows\temp\dnscmd.txt — giving blank report

All dnscmd command is exiting with exit code 1.

I am really running out of options here. Can someone please help?

BigFix is a 32-bit application; dnscmd.exe may only exist in the system32 folder, which incidentally is a 64-bit system folder on 64-bit systems.

I would try the following, as this will disable 32-bit redirection on 64-bit systems:

action uses wow64 redirection {not x64 of operating system}
waithidden cmd.exe /c dnscmd.exe /config /SecureResponses 0

Normally, you don’t need to call the full path for system executeables, but if that executable needs to run in 64-bit mode you do need to disable 64-bit redirection.

I would also suggest you run these in the fixlet debugger with wait instead of waithidden, and cmd.exe /k instead of /c. This way, you get to see the results of your action and can tweak the command line until you get it right.

1 Like

It worked like a charm in Fixlet debugger, have run an action on few servers, will let you know the result.

1 Like