Class DNS
The DNS Layer
Tables
DNS.new_args | DNS Layer constructor arguments |
DNS.OpCode | Pre-defined DNS OpCodes |
DNS.RCode | Pre-defined DNS Return Codes |
DNS.Type | Pre-defined DNS Types |
DNS.Class | Pre-defined DNS Class |
Methods
DNS:new ([args]) | Create a new DNS Layer |
DNS:add_query (query) | Add a query to the DNS Layer |
DNS:add_answer (answer) | Add an answer to the DNS Layer |
DNS:add_authority (authority) | Add an authority answer to the DNS Layer |
DNS:add_additional (additional) | Add an answer in the additional section of the DNS Layer |
DNS:queries () | List all queries found in the Layer |
DNS:answers () | List all answers found in the Layer |
DNS:authority () | List all answers found in the Layer |
DNS:additional () | List all answers found in the Layer |
DNS:id () | Get the DNS identification value |
DNS:opcode () | Get the DNS OpCode |
DNS:rcode () | Get the DNS Return Code |
DNS:qr () | Get the DNS QR flag |
DNS:aa () | Get the DNS AA flag |
DNS:tc () | Get the DNS TC flag |
DNS:rd () | Get the DNS RD flag |
DNS:ra () | Get the DNS RA flag |
DNS:z () | Get the DNS Z flag |
DNS:ad () | Get the DNS AD flag |
DNS:cd () | Get the DNS CD flag |
Class DNSQuery
DNS:new (args) | Create a new DNS query |
DNS.new_args | Constructor arguments |
DNS:print () | Get this object textual representation |
DNS:__tostring () | see print |
Class DNSAnswer
DNS:print () | Get this object textual representation |
DNS:__tostring () | see print |
Tables
- DNS.new_args
-
DNS Layer constructor arguments
Fields:
- DNS.OpCode
-
Pre-defined DNS OpCodes
Fields:
- Query
- IQuery
- Status
- Notify
- Update
Usage:
DNS.OpCode.Query
- DNS.RCode
-
Pre-defined DNS Return Codes
Fields:
- NoError
- FormatError
- ServerFailure
- NameError
- Refused
- YXDomain
- YXRRSet
- NXRRSet
- NotAuth
- NotZone
Usage:
if dns:rcode() == DNS.RCode then ... end
- DNS.Type
-
Pre-defined DNS Types
Fields:
- A
- AAAA
- NS
- CNAME
- SOA
- WKS
- PTR
- MX
- SRV
- A6
- OPT
- ANY
Usage:
DNS.Type.A
- DNS.Class
-
Pre-defined DNS Class
Fields:
- IN
Usage:
DNS.Class.IN
Methods
- DNS:new ([args])
-
Create a new DNS Layer
Parameters:
- args table see new_args (optional)
Returns:
-
DNS
dns
- DNS:add_query (query)
-
Add a query to the DNS Layer
Parameters:
- query DNSQuery
- DNS:add_answer (answer)
-
Add an answer to the DNS Layer
Parameters:
- answer DNSAnswer
- DNS:add_authority (authority)
-
Add an authority answer to the DNS Layer
Parameters:
- authority DNSAnswer
- DNS:add_additional (additional)
-
Add an answer in the additional section of the DNS Layer
Parameters:
- additional DNSAnswer
- DNS:queries ()
-
List all queries found in the Layer
Returns:
- DNS:answers ()
-
List all answers found in the Layer
Returns:
- DNS:authority ()
-
List all answers found in the Layer
Returns:
- DNS:additional ()
-
List all answers found in the Layer
Returns:
- DNS:id ()
-
Get the DNS identification value
Returns:
-
num
id
- DNS:opcode ()
-
Get the DNS OpCode
Returns:
-
num
opcode
- DNS:rcode ()
-
Get the DNS Return Code
Returns:
-
num
rcode
- DNS:qr ()
-
Get the DNS QR flag
Returns:
-
num
qr
- DNS:aa ()
-
Get the DNS AA flag
Returns:
-
num
aa
- DNS:tc ()
-
Get the DNS TC flag
Returns:
-
num
tc
- DNS:rd ()
-
Get the DNS RD flag
Returns:
-
num
rd
- DNS:ra ()
-
Get the DNS RA flag
Returns:
-
num
ra
- DNS:z ()
-
Get the DNS Z flag
Returns:
-
num
z
- DNS:ad ()
-
Get the DNS AD flag
Returns:
-
num
ad
- DNS:cd ()
-
Get the DNS CD flag
Returns:
-
num
cd
Class DNSQuery
A DNS Query
- DNS:new (args)
-
Create a new DNS query
Parameters:
- DNS.new_args
-
Constructor arguments
Fields:
- DNS:print ()
-
Get this object textual representation
Returns:
- DNS:__tostring ()
- see print
Class DNSAnswer
A DNS Answer