Ir para o conteúdo
ou

Software livre Brasil

 Voltar a Blog
Tela cheia

Algumas opções do dig

20 de Maio de 2013, 0:00 , por Software Livre Brasil - 0sem comentários ainda | Ninguém está seguindo este artigo ainda.
Visualizado 86 vezes
<p>Muitas pessoas gostam de usar o <strong>nslookup</strong> para pesquisar informação de DNS. Eu, particularmente eu prefiro usar o <strong>dig</strong> e logo mais abaixo tem algumas opções se você tiver interesse em usá-lo. ;)</p> <p>Como fazer uma consulta sobre o reverso de endereço de rede (IP):</p> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> <span class="line-number">2</span> <span class="line-number">3</span> <span class="line-number">4</span> <span class="line-number">5</span> <span class="line-number">6</span> <span class="line-number">7</span> <span class="line-number">8</span> <span class="line-number">9</span> <span class="line-number">10</span> <span class="line-number">11</span> <span class="line-number">12</span> <span class="line-number">13</span> <span class="line-number">14</span> <span class="line-number">15</span> <span class="line-number">16</span> <span class="line-number">17</span> <span class="line-number">18</span> </pre></td><td class="code"><pre><code class=""><span class="line">$ dig -x 8.8.8.8 </span><span class="line"> </span><span class="line">; &lt;&lt;>> DiG 9.8.4-rpz2+rl005.12-P1 &lt;&lt;>> -x 8.8.8.8 </span><span class="line">;; global options: +cmd </span><span class="line">;; Got answer: </span><span class="line">;; ->>HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 6197 </span><span class="line">;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 </span><span class="line"> </span><span class="line">;; QUESTION SECTION: </span><span class="line">;8.8.8.8.in-addr.arpa. IN PTR </span><span class="line"> </span><span class="line">;; ANSWER SECTION: </span><span class="line">8.8.8.8.in-addr.arpa. 41387 IN PTR google-public-dns-a.google.com. </span><span class="line"> </span><span class="line">;; Query time: 223 msec </span><span class="line">;; SERVER: 200.175.5.139#53(200.175.5.139) </span><span class="line">;; WHEN: Fri May 17 22:54:23 2013 </span><span class="line">;; MSG SIZE rcvd: 82</span></code></pre></td></tr></table></div> <p>No caso acima o DNS reverso para o endereço de rede <strong>8.8.8.8</strong> é <strong>google-public-dns-a.google.com</strong>. Porém, se quisermos saber o(s) servidor(es) de email de um domínio?</p> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> <span class="line-number">2</span> <span class="line-number">3</span> <span class="line-number">4</span> <span class="line-number">5</span> <span class="line-number">6</span> <span class="line-number">7</span> <span class="line-number">8</span> <span class="line-number">9</span> <span class="line-number">10</span> <span class="line-number">11</span> <span class="line-number">12</span> <span class="line-number">13</span> <span class="line-number">14</span> <span class="line-number">15</span> <span class="line-number">16</span> <span class="line-number">17</span> <span class="line-number">18</span> <span class="line-number">19</span> <span class="line-number">20</span> <span class="line-number">21</span> <span class="line-number">22</span> <span class="line-number">23</span> <span class="line-number">24</span> <span class="line-number">25</span> <span class="line-number">26</span> <span class="line-number">27</span> <span class="line-number">28</span> <span class="line-number">29</span> <span class="line-number">30</span> <span class="line-number">31</span> <span class="line-number">32</span> </pre></td><td class="code"><pre><code class=""><span class="line">dig mx gmail.com </span><span class="line"> </span><span class="line">; &lt;&lt;>> DiG 9.8.4-rpz2+rl005.12-P1 &lt;&lt;>> mx gmail.com </span><span class="line">;; global options: +cmd </span><span class="line">;; Got answer: </span><span class="line">;; ->>HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 1486 </span><span class="line">;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 8 </span><span class="line"> </span><span class="line">;; QUESTION SECTION: </span><span class="line">;gmail.com. IN MX </span><span class="line"> </span><span class="line">;; ANSWER SECTION: </span><span class="line">gmail.com. 2851 IN MX 40 alt4.gmail-smtp-in.l.google.com. </span><span class="line">gmail.com. 2851 IN MX 20 alt2.gmail-smtp-in.l.google.com. </span><span class="line">gmail.com. 2851 IN MX 5 gmail-smtp-in.l.google.com. </span><span class="line">gmail.com. 2851 IN MX 30 alt3.gmail-smtp-in.l.google.com. </span><span class="line">gmail.com. 2851 IN MX 10 alt1.gmail-smtp-in.l.google.com. </span><span class="line"> </span><span class="line">;; ADDITIONAL SECTION: </span><span class="line">gmail-smtp-in.l.google.com. 197 IN A 74.125.140.27 </span><span class="line">gmail-smtp-in.l.google.com. 259 IN AAAA 2607:f8b0:4002:c04::1b </span><span class="line">alt3.gmail-smtp-in.l.google.com. 44 IN A 173.194.65.26 </span><span class="line">alt3.gmail-smtp-in.l.google.com. 62 IN AAAA 2a00:1450:4013:c00::1b </span><span class="line">alt1.gmail-smtp-in.l.google.com. 267 IN A 173.194.73.27 </span><span class="line">alt1.gmail-smtp-in.l.google.com. 171 IN AAAA 2607:f8b0:400c:c02::1a </span><span class="line">alt4.gmail-smtp-in.l.google.com. 190 IN A 173.194.70.27 </span><span class="line">alt4.gmail-smtp-in.l.google.com. 31 IN AAAA 2a00:1450:4001:c02::1a </span><span class="line"> </span><span class="line">;; Query time: 17 msec </span><span class="line">;; SERVER: 200.175.5.139#53(200.175.5.139) </span><span class="line">;; WHEN: Fri May 17 23:03:30 2013 </span><span class="line">;; MSG SIZE rcvd: 326</span></code></pre></td></tr></table></div> <p>Consultar os servidores DNS de um domínio?</p> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> <span class="line-number">2</span> <span class="line-number">3</span> <span class="line-number">4</span> <span class="line-number">5</span> <span class="line-number">6</span> <span class="line-number">7</span> <span class="line-number">8</span> <span class="line-number">9</span> <span class="line-number">10</span> <span class="line-number">11</span> <span class="line-number">12</span> <span class="line-number">13</span> <span class="line-number">14</span> <span class="line-number">15</span> <span class="line-number">16</span> <span class="line-number">17</span> <span class="line-number">18</span> <span class="line-number">19</span> <span class="line-number">20</span> <span class="line-number">21</span> <span class="line-number">22</span> <span class="line-number">23</span> <span class="line-number">24</span> <span class="line-number">25</span> <span class="line-number">26</span> <span class="line-number">27</span> </pre></td><td class="code"><pre><code class=""><span class="line">$dig NS gmail.com </span><span class="line"> </span><span class="line">; &lt;&lt;>> DiG 9.8.4-rpz2+rl005.12-P1 &lt;&lt;>> NS gmail.com </span><span class="line">;; global options: +cmd </span><span class="line">;; Got answer: </span><span class="line">;; ->>HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 15754 </span><span class="line">;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 4 </span><span class="line"> </span><span class="line">;; QUESTION SECTION: </span><span class="line">;gmail.com. IN NS </span><span class="line"> </span><span class="line">;; ANSWER SECTION: </span><span class="line">gmail.com. 337395 IN NS ns2.google.com. </span><span class="line">gmail.com. 337395 IN NS ns4.google.com. </span><span class="line">gmail.com. 337395 IN NS ns3.google.com. </span><span class="line">gmail.com. 337395 IN NS ns1.google.com. </span><span class="line"> </span><span class="line">;; ADDITIONAL SECTION: </span><span class="line">ns4.google.com. 299858 IN A 216.239.38.10 </span><span class="line">ns3.google.com. 299798 IN A 216.239.36.10 </span><span class="line">ns1.google.com. 299798 IN A 216.239.32.10 </span><span class="line">ns2.google.com. 299824 IN A 216.239.34.10 </span><span class="line"> </span><span class="line">;; Query time: 21 msec </span><span class="line">;; SERVER: 200.175.5.139#53(200.175.5.139) </span><span class="line">;; WHEN: Fri May 17 23:07:04 2013 </span><span class="line">;; MSG SIZE rcvd: 170</span></code></pre></td></tr></table></div> <p>Consultar um servidor DNS responsável por um domínio?</p> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> <span class="line-number">2</span> <span class="line-number">3</span> <span class="line-number">4</span> <span class="line-number">5</span> <span class="line-number">6</span> <span class="line-number">7</span> <span class="line-number">8</span> <span class="line-number">9</span> <span class="line-number">10</span> <span class="line-number">11</span> <span class="line-number">12</span> <span class="line-number">13</span> <span class="line-number">14</span> <span class="line-number">15</span> <span class="line-number">16</span> <span class="line-number">17</span> <span class="line-number">18</span> <span class="line-number">19</span> <span class="line-number">20</span> <span class="line-number">21</span> </pre></td><td class="code"><pre><code class=""><span class="line">$dig A www.google.com.br @ns1.google.com </span><span class="line"> </span><span class="line">; &lt;&lt;>> DiG 9.8.4-rpz2+rl005.12-P1 &lt;&lt;>> A www.google.com.br @ns1.google.com </span><span class="line">;; global options: +cmd </span><span class="line">;; Got answer: </span><span class="line">;; ->>HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 53502 </span><span class="line">;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0 </span><span class="line">;; WARNING: recursion requested but not available </span><span class="line"> </span><span class="line">;; QUESTION SECTION: </span><span class="line">;www.google.com.br. IN A </span><span class="line"> </span><span class="line">;; ANSWER SECTION: </span><span class="line">www.google.com.br. 300 IN A 74.125.234.87 </span><span class="line">www.google.com.br. 300 IN A 74.125.234.88 </span><span class="line">www.google.com.br. 300 IN A 74.125.234.95 </span><span class="line"> </span><span class="line">;; Query time: 12 msec </span><span class="line">;; SERVER: 216.239.32.10#53(216.239.32.10) </span><span class="line">;; WHEN: Fri May 17 23:11:23 2013 </span><span class="line">;; MSG SIZE rcvd: 83</span></code></pre></td></tr></table></div> <p>Para saber mais&#8230; ;)</p> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span> </pre></td><td class="code"><pre><code class=""><span class="line">$man dig</span></code></pre></td></tr></table></div>
Fonte: http://www.fernandoike.com/2013/05/20/algumas-opcoes-do-dig/

0sem comentários ainda

Enviar um comentário

Os campos são obrigatórios.

Se você é um usuário registrado, pode se identificar e ser reconhecido automaticamente.