title: How can I control de output in bash using dig?
body: <p>I using the following bash to get DNS records of multiples domains inside domains.txt</p>
  
  <pre><code>#!/bin/bash
  for domain in $(cat domains.txt); do dig @8.8.8.8 $domain ANY +multiline +noall +answer +nocmd; done
  </code></pre>
  
  <p>Current dig output is:</p>
  
  <pre><code>; &lt;&lt;&gt;&gt; DiG 9.8.3-P1 &lt;&lt;&gt;&gt; @8.8.8.8 aeapi.bluetail.salesforce.com ANY +multiline +noall +answer +nocmd
  ; (1 server found)
  ;; global options: +cmd
  site.com. 59 IN A 0.0.0.1
  site.com. 59 IN A 0.0.0.0
  </code></pre>
  
  <p>And I like get the output on the following format:</p>
  
  <pre><code>site.com,0.0.0.1
  site2.com,0.0.0.2
  site3.com,0.0.0.4
  </code></pre>
  
  <p>how can I do this? help would be appreciated</p>