Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I know you may have your reasons for looking at the record in a particular way, but why not use a module that is made for doing this, Net::DNS?

Below was a quick example of using Net::DNS to retrieve similar information:

#!/usr/bin/perl use strict; use warnings; use Net::DNS; my $res = Net::DNS::Resolver->new; my $target; # Single-target test $target = q{}; # To run from command-line, uncomment loop below # foreach my $target ( @ARGV ) { my $reply = $res->query( q{}, q{CAA}, ); if ( $reply ) { foreach my $rr ( $reply->answer ) { # Complete response $rr->print; # Individual response components print qq{Owner: }, $rr->owner, qq{\n}; print qq{Type: }, $rr->type, qq{\n}; print qq{Class: }, $rr->class, qq{\n}; print qq{TTL: }, $rr->ttl, qq{\n}; # RR-specific data as string print qq{RDstring: }, $rr->rdstring, qq{\n}; # RR-specific data components print qq{Flags: }, $rr->flags, qq{\n}; print qq{Critical: }, $rr->critical, qq{\n}; print qq{Tag: }, $rr->tag, qq{\n}; print qq{Value: }, $rr->value, qq{\n}; print qq{\n}; } else { warn qq{query failed: }, $res->errorstring, qq{\n}; } } }

Output: 6168 IN CAA 0 iodef\@en Owner: Type: CAA Class: IN TTL: 6168 RDstring: 0 iodef\ Flags: 0 Critical: 0 Tag: iodef Value: 6168 IN CAA 0 issue Owner: Type: CAA Class: IN TTL: 6168 RDstring: 0 issue Flags: 0 Critical: 0 Tag: issue Value:

Hope that helps.

In reply to Re: tinyDNS deconstruct. by atcroft
in thread tinyDNS deconstruct. by 0xdeadbad

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (6)
    As of 2020-11-25 22:58 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found