--- a/mod_register_dnsbl/mod_register_dnsbl.lua Fri Feb 23 21:59:28 2018 +0100
+++ b/mod_register_dnsbl/mod_register_dnsbl.lua Fri Feb 23 22:00:18 2018 +0100
@@ -1,6 +1,7 @@
local adns = require "net.adns";
local async = require "util.async";
local inet_pton = require "util.net".pton;
+local to_hex = require "util.hex".to;
local rbl = module:get_option_string("registration_rbl");
@@ -10,6 +11,8 @@
if #n == 4 then
local a,b,c,d = n:byte(1,4);
return ("%d.%d.%d.%d.%s"):format(d,c,b,a, suffix);
+ elseif #n == 16 then
+ return to_hex(n):reverse():gsub("%x", "%1.") .. suffix;
end
end