John Rudd wrote:
Stuart Johnston wrote:
John Rudd wrote:

I've put up a new version of Relay checker, in
...
I expect I might, at some point, switch from using a dynamic score in the plugin, to a normal score. But that's the only change I expect to make, aside from bug fixes (if there are any), and/or a switch to using Net::DNS.

I wonder if there is any way for a plugin to hook into SA's DNS routines. That might be better than calling Net::DNS directly.


If anyone knows of a way, I'd look into it. I need to do both fwd and reverse lookups though.

The simple version might look like:

# Get resolver
my $dns = $pms->{parser_dns_pms};

# Reverse
$hostname = $dns->lookup_ptr ($ip);

# Forward
my @addrs = $dns->lookup_a ($hostname);

I'm not sure if the above code is really in any way better than the way you have it now. There are also functions for doing dns in the background but I don't know if that would be practical or helpful for your plugin.

You also might consider using the rdns that SA has already calculated to save 
one query:

$hostname = $relay->{ip};

Reply via email to