[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Re: MacPerl reverse DNS



At 11:58 AM +0200 7/10/00, Tinus - Martijn Houtman wrote:
>Hi there,
>
>I am busy making a MacPerl script which logs website statistics. My point
>is to log the hostmask that comes with the ip-number, thus a reverse DNS.
>All i know is that on a Mac, DNS is pretty slow unless using the
>commercial DNS server.
>I looked on the net and found some ways in doing this.
>One way was using some modules for perl, Net:DNS. That module comes with a
>fast DNS resolver, but isn't available for MacPerl. What i'd like to know
>is, wether ot not it is possible for me to easily port a *nix/win32 module
>to MacPerl. Or maybe the DNS is already ported?

It doesn't need to be ported.  Just get it from CPAN.  Most things 
don't need to be ported (or the necessary changes are included in the 
main distribution), so CPAN is always the place to start.

>For now, i got this piece of code:
>
>  $ipname[$dns] = (gethostbyaddr(pack("C4",split(/\./,$ip[$dns-1])),2))[0];
>
>This works, but sometimes makes the server crash, and is almost never able
>to find the hostmask. Yet on my linux box it runs as hell. I already tried
>several nameservers, yet with no luck.

So why not use the Linux box as the nameserver?  That way you won't 
make the MacOS server crash.  Look into Dan Bernstein'd djbdns 
<http://pobox.com/~djb/djbdns.html>, which is a marvelous nameserver, 
easier to configure than BIND and completely without BIND's security 
holes.  It's easy to install on Linux (or any other Unix).

>The servers are running macperl 5.2.0r4 and webstar 3.0.
>
>Looking forward to your reply!
>With regards,
>
>Martijn Houtman
>VT Internet Produkties

-- 
--
Paul Schinder
schinder@pobox.com

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org