PTR by yamaya

z="0000"T=table
for s in io.lines()do
s=":"..s.."."a,b,c,d=s:match(z.rep("(%d+%.)",4))i=1 j=1
for t in s:gmatch":(%x*)"do T[i]=s.sub(z..t,-4)i=i+1 j=t==""and i or j end
for k=i,8 do T:insert(j,z)end
print(a and d..c..b..a.."in-addr.arpa"or T:concat("",1,8):reverse():gsub(".","%1.").."ip6.arpa")end

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page