luci-mod-admin-full: use rpcd-mod-rrdns for reverse DNS lookups
authorJo-Philipp Wich <jo@mein.io>
Tue, 11 Jul 2017 12:18:40 +0000 (14:18 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 11 Jul 2017 12:18:40 +0000 (14:18 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-admin-full/luasrc/controller/admin/status.lua

index ad575e0d2611e4c0c8baae77fe15e2bec4a62e07..22e1b7e173a5907bc8c45eadec4b7e5a45d8d552 100644 (file)
@@ -139,14 +139,12 @@ function action_connections()
 end
 
 function action_nameinfo(...)
-       local i
-       local rv = { }
-       for i = 1, select('#', ...) do
-               local addr = select(i, ...)
-               local fqdn = nixio.getnameinfo(addr)
-               rv[addr] = fqdn or (addr:match(":") and "[%s]" % addr or addr)
-       end
+       local util = require "luci.util"
 
        luci.http.prepare_content("application/json")
-       luci.http.write_json(rv)
+       luci.http.write_json(util.ubus("network.rrdns", "lookup", {
+               addrs = { ... },
+               timeout = 5000,
+               limit = 1000
+       }) or { })
 end