title: dig-like functionality on windows?
body: <p>On a windows system, I'm trying to gather all the IP addresses for a DNS name &amp; call a tool with each IP address.  I know how to do it from a shell script - but not how to do it from a batch or powershell file.  </p>
  
  <p>I want to port this to windows..</p>
  
  <pre><code>#!/usr/bin/env bash
  # Get all the IPs for our server instance
  # and pass it to "p4 trust" to update the .p4trust file
  for address in $(dig perforce.example.com +short)
  do
      echo "processing address: $address:1666"
      p4 -p "ssl:$address:1666" trust -y -f || true
  done
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li>is there a pre-installed windows <code>dig</code> equivalent that will only return the IPs of the DNS record?</li>
  <li>in a batch or powershell file, how do you iterate over multiple results from another application?</li>
  </ol>