I wanted to add to this thread a Windows equivalent which I needed for myself. I've added two new DCI's to my agent's config file:
ExternalParameter = DNS.Lookup(*):dig +noall +short @$1 $2 A
ExternalParameterShellExec = DNS.Check(*):dig +noall +short @$1 $2 A | find /c "$3"
The first returns the IP looked up as I wanted to be able to check it for myself, the second is the equivalent of the example from Victor that returns just a code. The reason for the "ShellExec" is because "find" is a built-in function of the command-prompt, and "/c" returns the count.
You'll also need a copy of "dig" for Windows which can be found here.