title: Capturing nslookup shell output with C#
body: <p>I have a command-line process I would like to automate and capture in C#.</p>
  
  <p>At the command line, I type:</p>
  
  <pre><code>nslookup
  </code></pre>
  
  <p>This launches a shell which gives me a > prompt. At the prompt, I then type:</p>
  
  <pre><code>ls -a mydomain.local
  </code></pre>
  
  <p>This returns a list of local CNAMEs from my primary DNS server and the physical machines they are attached to.</p>
  
  <p>What I would like to do is automate this process from C#. If this were a simple command, I would just use Process.StartInfo.RedirectStandardOutput = true, but the requirement of a second step is tripping me up.</p>