initial
This commit is contained in:
commit
c158e58697
31
surok.lua
Normal file
31
surok.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
local dns = require "org.conman.dns"
|
||||
|
||||
e,err = dns.encode {
|
||||
id = math.random(),
|
||||
query = true,
|
||||
rd = true,
|
||||
opcode = 'query',
|
||||
question = {
|
||||
name = '_http._matrix.admins._tcp.marathon.mesos.',
|
||||
type = 'SRV',
|
||||
class = 'in'
|
||||
}
|
||||
}
|
||||
|
||||
if e == nil then
|
||||
print('error: ', err)
|
||||
os.exit(2)
|
||||
end
|
||||
|
||||
r,err = dns.query('10.15.56.154',e)
|
||||
|
||||
if r == nil then
|
||||
print("error: ",err)
|
||||
os.exit(2)
|
||||
end
|
||||
|
||||
d = dns.decode(r)
|
||||
|
||||
for i = 1, #d.answers do
|
||||
print(d.answers[i].target, d.answers[i].port)
|
||||
end
|
Loading…
Reference in New Issue
Block a user