Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Another question is, do you need to resolve the IP addresses within Perl?
If you're doing a log analysis, and need to resolve the addresses within that log, there are a veritable cornucopia of tools out there to achieve that.
One that I use, dns-terror (now called 'fastresolve') is screamingly fast, and beats every Perl solution I've yet seen.
The caveat with that, is that it loads the whole DNS cache file into memory.. I've seen it chew up most of the available memory on a logging host, and bring it to it's knees.. However, that was with millions of IP addresses in cache..
Another pre-resolver is jdresolve, which, though slower than fastresolve is extremely fast, and makes use of the ADNS Perl modules. Perhaps, downloading the source for jdresolve, and reading it, or using it as a pre-processor would help.
For doing many processes on a file, I find that it's often better to use dedicated tools as filters, and pipe the data through them. In many cases, I've gained huge performace benefits from this, along with the ability to easily add more functionality by adding an extra filter.
To achieve this while in a Perl script, the open function with the pipe from program output to script (open(HANDLE,"program|");) would work a treat, taking resolved data from the original file, and giving you a handle on it.

HTH

Malk

In reply to Re: resolving ip's to names in a text file by Malkavian
in thread resolving ip's to names in a text file by RayRay459

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-25 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found