RBLClient(3pm)

πŸ“¦
version 0.5 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Net::RBLClient πŸ’–

okay bestie, so this is a User Contributed Perl Documentation page for Net::RBLClient β€” that's the module, and the manpage itself is filed under RBLClient(3pm) in section 3pm. pull up a chair, we're doing DNS detective work together πŸ•΅οΈβ™€οΈβœ¨


🌈 NAME 🌈

Net::RBLClient β€” it queries a whole bunch of Realtime Blackhole Lists at the same time, in parallel, because waiting is not the vibe.


πŸŽ€ SYNOPSIS πŸŽ€

use Net::RBLClient;
my $rbl = Net::RBLClient->new;
$rbl->lookup('211.101.236.160');
my @listed_by = $rbl->listed_by;

literally four lines and you're done, slay πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

This module exists to figure out which RBLs are listing a particular IP address. It parallelizes the requests so you get a fast response β€” no cap, speed is the whole point.

so like, an RBL (Realtime Blackhole List) is a list of IP addresses that meet some criteria, e.g. being involved in Unsolicited Bulk Email. every RBL has its own criteria for adding and removing addresses β€” they're all different, they're all doing their own thing πŸ™ˆ

⚠️ real talk: if you wanna block email or other traffic to/from your network based on one or more RBLs, you should carefully study the behavior of those RBLs before and during such blocking. like, do your research first, bestie. this is not a vibes-only situation.

✨ CONSTRUCTOR ✨

new( [ARGS] )

takes an optional hash of arguments β€” here's the whole menu, no secrets:

  • lists β€” an arraref (yes, arraref, that's what it says 😭) of (sub)domains representing RBLs. each element in the array is a string similar to 'relays.somerbl.org'. use this when you want to query a specific list of RBLs β€” if you omit this argument, a large list of RBLs gets queried instead.
  • query_txt β€” set this to true if you want Net::RBLClient to also query for TXT records, which is where a lot of RBLs stash extra info about why an IP address got included, or links to pages that have that info. then you can grab all of that with the "txt_hash()" method. 🎁
  • max_time β€” the maximum time in seconds that the lookup function should take. heads up though: the function can actually take up to max_time + timeout seconds. max_time need not be integer. and yeah, if the lookup returns because of max_time, some DNS replies will be missed. πŸ‘€
    • Default: 8 seconds.
  • timeout β€” the maximum time in seconds spent awaiting each DNS reply packet. the only reason to change this is if max_time is decreased to a small value.
    • Default: 1 second.
  • max_hits β€” a hit is an affirmative response, i.e. "yes this IP address is on this list." if max_hits hits are received, lookup() returns immediately, which lets the calling program save time. ⏱️
    • Default: 1000 (which is effectively out of the picture).
  • max_replies β€” a reply from an RBL could be affirmative or negative. either way it counts towards max_replies. Lookup() returns when max_replies replies have been received.
  • udp_maxlen β€” the maximum number of bytes read from a DNS reply packet. there's probably no reason to change this tbh.
    • Default: 4000
  • server β€” the local nameserver to use for all queries. should be either a resolvable hostname or a dotted quad IP address.
    • by default, the first nameserver in /etc/resolv.conf will be used.

πŸ‘‘ METHODS πŸ‘‘

  • lookup( IPADDR ) β€” look up one IP address on all RBLs previously defined. the IP address must be expressed in dotted quad notation, like '1.2.3.4'. "Lookup()" returns 1.
  • listed_by() β€” return an array of RBLs which block the specified IP. the RBLs are indicated via the (sub)domain used for DNS query. the calling program must first call "lookup()". don't skip that step, fr fr πŸ™
  • listed_hash() β€” return a hash whose keys are the RBLs which block the specified IP, represented as in "listed_by()". if the RBL returned an A record, the value for that key will be the IP address in the A record β€” typically 127.0.0.1 – 127.0.0.4. if the RBL returned a CNAME, the value will be the hostname, typically used for a comment on why the IP address is listed. πŸ’¬
  • txt_hash() β€” return a hash (or a reference to that hash if called in a scalar context) whose keys are the RBLs which block the specified IP, represented as in "listed_by()". if the RBL returned TXT records containing additional information, the value will contain this information (several TXT records from one RBL will be joined by semicolons, but this should not happen), and if not, it will be undef.

🌸 AUTHOR 🌸

Asher Blum <asher@wildspark.com> πŸ’–


⭐ CREDITS ⭐

Martin H. Sluka <martin@sluka.de> 🫢


Copyright (C) 2002 Asher Blum. All rights reserved. This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie!! πŸŽ‰ this one's running on perl v5.34.0, dated 2022-06-30 β€” go forth and query those RBLs, you absolute icon πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from