Fellow Monks i come to you in a bit of a pickle. I have been asked to parse some access logs and give feedback on who is using a utility ( the logs are very apache like) i have broken it down to where i can get day and ip and all that but they didn't like having the "ip address" cause they don't know what that ip is so i am using Net::Nslookup. I can get type => 'A' records and have turned on all the debugging and the dns is returning but i am not getting a value back i have even thought of the fact that it may be an arrary and haven't found anything there either. I have even created some test code and it does not work. I will use the test code to post here as it is much smaller and has the same issue:
#!/usr/bin/perl use strict; use Net::Nslookup; my $ip = nslookup( domain => 'www.yahoo.com', type => 'A' ); my $fqdn = nslookup ( domain => $ip, type => 'PTR' ); print "$ip -> $fqdn \n";
output:
69.147.76.15 ->  

Debug Output:
Performing 'A' lookup on `www.yahoo.com' at ./test.pl line 9
Performing 'PTR' lookup on `69.147.76.15' at ./test.pl line 11
;; search(69.147.76.15, PTR)
;; setting up an AF_INET() family type UDP socket
;; send_udp(24.28.201.85:53)
;; answer from 24.28.201.85:53 : 251 bytes
;; HEADER SECTION
;; id = 46054
;; qr = 1    opcode = QUERY    aa = 0    tc = 0    rd = 1
;; ra = 1    ad = 0    cd = 0    rcode  = NOERROR
;; qdcount = 1  ancount = 1  nscount = 5  arcount = 5

;; QUESTION SECTION (1 record)
;; 15.76.147.69.in-addr.arpa.   IN      PTR

;; ANSWER SECTION (1 record)
15.76.147.69.in-addr.arpa.      1166    IN      PTR     f1.www.vip.re1.yahoo.com.

;; AUTHORITY SECTION (5 records)
76.147.69.in-addr.arpa. 171250  IN      NS      ns2.yahoo.com.
76.147.69.in-addr.arpa. 171250  IN      NS      ns3.yahoo.com.
76.147.69.in-addr.arpa. 171250  IN      NS      ns4.yahoo.com.
76.147.69.in-addr.arpa. 171250  IN      NS      ns5.yahoo.com.
76.147.69.in-addr.arpa. 171250  IN      NS      ns1.yahoo.com.

;; ADDITIONAL SECTION (5 records)
ns5.yahoo.com.  51462   IN      A       119.160.247.124
ns4.yahoo.com.  22807   IN      A       68.142.196.63
ns3.yahoo.com.  22807   IN      A       217.12.4.104
ns2.yahoo.com.  22807   IN      A       68.142.255.16
ns1.yahoo.com.  77787   IN      A       68.180.131.16

69.147.76.15 ->  

In reply to Net::Nslookup PTR lookup help by blackstealth

Title:
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, 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:
    & &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.