Greetings,

I'm experimenting with a couple of HTTPd's (names removed to protect the guilty innocent) that are fairly light, but don't resolve the connecting IP addresses (provide the HOST name) in the logs. I've contacted the devs of both of them asking why not, or if when. But the answers were basically, too heavy && too slow. Which, to me, seemed more an excuse. As the facility could have simply been implemented as an option. But they're not my HTTPd's.

So, I did some experimentation, and was able to get my web pages to return the HOST names of the connecting IP's in the following manner (all my pages are CGI/Perl):

... use strict; use feature qw(say); use Socket; ... my $remote_ip = $ENV{REMOTE_ADDR}; # note: don't try this at home kids, unless you have a fast local DNS +(server) my $remote_host = gethostbyaddr(inet_aton($remote_ip), AF_INET);
Which, as you might imagine; allows me to return the HOST name contained inside $remote_host.

So, Perl will give me what the HTTPD won't -- I love Perl! So how might I best achieve the same simultaneously within my HTTPd logs? I'm guessing pipe is probably involved here. But I'd really rather run this whole thing past the many brilliant minds, and monks here. In hopes of getting the best solution. :-)

Thanks!

Evil is good, for without it, Good would have no value
¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH


In reply to how to resolve IP's in an HTTPd that doesn't resolve them? by taint

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.