As the /dns command returns it's results in an event, you can't do it with the built-in commands.

There are any number of DLL's available that will do this inline for you if you desparetly need one. Check the scripting sites for them.

That being said, does anybody know if you can do this with a $com() call? I don't know enough about COM stuff to answer that.