This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

dns lookup
#2
Use this:
Code:
function resolve(domain)
  local sock = require('socket').udp()
  local res

  if sock:setpeername(domain, 123) then
    res = sock:getpeername()
  end

  sock:close()
  return res
end

ip = resolve('openrb.com')
log(ip)
Reply


Messages In This Thread
dns lookup - by toujour - 18.10.2021, 12:55
RE: dns lookup - by admin - 18.10.2021, 14:47
RE: dns lookup - by toujour - 20.10.2021, 12:22
RE: dns lookup - by myg - 20.02.2023, 10:45
RE: dns lookup - by admin - 20.02.2023, 11:03
RE: dns lookup - by myg - 22.02.2023, 12:58
RE: dns lookup - by admin - 22.02.2023, 14:15
RE: dns lookup - by myg - 22.02.2023, 14:16
RE: dns lookup - by admin - 22.02.2023, 14:18
RE: dns lookup - by myg - 22.02.2023, 14:27

Forum Jump: