I am trying to replicate the below code, but with no modules..
Now i'm sure it can be done with the pack() function, but im trying to replicate the Exact responce below (This how i would do it with Net::DNS::Packet:
my $dnspacket = new Net::DNS::Packet( 'www.google.com, 'IN', 'ANY' );
$dnspacket->header->qr(0); #Query Responce Flag
$dnspacket->header->aa(0); #Authoritative Flag
$dnspacket->header->tc(0); #Truncated Flag
$dnspacket->header->ra(0); #Recursion Desired
$dnspacket->header->rd(1); #Recursion Available
$udp_max = $dnspacket->header->size(1024);
The domain im querying changes per request. which is why i need that to somehow be an option before packing. Im currently using Net::DNS, i have reasons for not wanting to use it. Mainly being its a pain, and i rather do it raw.
I was looking at this thread: http://www.perlmonks.org/?node_id=724155
if i could just set my flags, and set the domain to query. (which looks like its already an option from that solution on the thread)
Pretty stumped here.
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, details, 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, summary, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.