Thanks for making it possible to DNS query using lua. I am sending below query request and getting an error : " attempt to call a number value" while making call to : sock:send(query)
query: "êT\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0004maps\ngoogleapis\u0003com\u0000\u0000\u0001\u0000\u0001"
Error:failed to send request to UDP server 8.8.8.8:53: attempt to call a number value
Frame 1063: 79 bytes on wire (632 bits), 79 bytes captured (632 bits) on interface 0
Ethernet II, Src: Apple_c1:50:1a (78:31:c1:c1:50:1a), Dst: VerizonB_90:78:42 (c8:a7:0a:90:78:42)
Internet Protocol Version 4, Src: 192.168.1.155, Dst: 8.8.8.8
User Datagram Protocol, Src Port: 54677 (54677), Dst Port: 53 (53)
Domain Name System (query)
[Response In: 1074]
Transaction ID: 0xea54
Flags: 0x0100 Standard query
0... .... .... .... = Response: Message is a query
.000 0... .... .... = Opcode: Standard query (0)
.... ..0. .... .... = Truncated: Message is not truncated
.... ...1 .... .... = Recursion desired: Do query recursively
.... .... .0.. .... = Z: reserved (0)
.... .... ...0 .... = Non-authenticated data: Unacceptable
Questions: 1
Answer RRs: 0
Authority RRs: 0
Additional RRs: 0
Queries
maps.googleapis.com: type A, class IN
Name: maps.googleapis.com
[Name Length: 19]
[Label Count: 3]
Type: A (Host Address) (1)
Class: IN (0x0001)
Frame 1074: 129 bytes on wire (1032 bits), 129 bytes captured (1032 bits) on interface 0
Ethernet II, Src: VerizonB_90:78:42 (c8:a7:0a:90:78:42), Dst: Apple_c1:50:1a (78:31:c1:c1:50:1a)
Internet Protocol Version 4, Src: 8.8.8.8, Dst: 192.168.1.155
User Datagram Protocol, Src Port: 53 (53), Dst Port: 54677 (54677)
Domain Name System (response)
[Request In: 1063]
[Time: 0.031131000 seconds]
Transaction ID: 0xea54
Flags: 0x8180 Standard query response, No error
1... .... .... .... = Response: Message is a response
.000 0... .... .... = Opcode: Standard query (0)
.... .0.. .... .... = Authoritative: Server is not an authority for domain
.... ..0. .... .... = Truncated: Message is not truncated
.... ...1 .... .... = Recursion desired: Do query recursively
.... .... 1... .... = Recursion available: Server can do recursive queries
.... .... .0.. .... = Z: reserved (0)
.... .... ..0. .... = Answer authenticated: Answer/authority portion was not authenticated by the server
.... .... ...0 .... = Non-authenticated data: Unacceptable
.... .... .... 0000 = Reply code: No error (0)
Questions: 1
Answer RRs: 2
Authority RRs: 0
Additional RRs: 0
Queries
maps.googleapis.com: type A, class IN
Name: maps.googleapis.com
[Name Length: 19]
[Label Count: 3]
Type: A (Host Address) (1)
Class: IN (0x0001)
Answers
maps.googleapis.com: type CNAME, class IN, cname googleapis.l.google.com
Name: maps.googleapis.com
Type: CNAME (Canonical NAME for an alias) (5)
Class: IN (0x0001)
Time to live: 3599
Data length: 22
CNAME: googleapis.l.google.com
googleapis.l.google.com: type A, class IN, addr 173.194.204.95
Name: googleapis.l.google.com
Type: A (Host Address) (1)
Class: IN (0x0001)
Time to live: 299
Data length: 4
Address: 173.194.204.95