NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

Replies are listed 'Best First'.
Re: Blocking non-USA ips and\or DNS
by merlyn (Sage) on Feb 08, 2002 at 20:44 UTC
    "USA" when used with "IP" means nothing. You can't solve this technically. You'll have to shift to a legal-enforcement solution, not a technical one.

    -- Randal L. Schwartz, Perl hacker

(cLive ;-) Re: Blocking non-USA ips and\or DNS
by cLive ;-) (Prior) on Feb 08, 2002 at 20:57 UTC
    Although, as merlyn states, you can never guarantee a user's location, geo-ip may be what you're looking for.

    cLive ;-)

Re: Blocking non-USA ips and\or DNS
by JayBonci (Curate) on Feb 08, 2002 at 21:21 UTC
    The only sort of IP->location information is based roughly on the registrar which is kept in the ARIN database located at arin.net. If you had all that data available, then you could make a rough guess, but it would be just that, a blind shot in the dark. IPs move all over the global network, and as merlyn mentioned above, it would be a legal enforcement problem.

    If you wanted to check out where your hits are coming from (in a demographic sense after the fact), then you could use that db, which oftentimes has contact information for abuse and such. Clickwrap agreements have been held up in court regarding software, so if you have a legitimate legal concern (exporting crypto software, etc), then you may want to check with a lawyer, but basically an agreement on the site is prolly where you'd want to go next.

        --jay
Re: Blocking non-USA ips and\or DNS
by Anonymous Monk on Feb 09, 2002 at 07:49 UTC
    Im trying to find a way to block any non-USA, Canada IPs and\or DNS names any ideas on how to do this??????????? im not suer y you say this is a Non-perl question. I want to know how you can block using maby the $ENV{REMOTE_HOST} and something to onny alow .com, .net, .org as the last 4 chars. IE ... XXX.XX-XXXX.XX.com