Package io.netty.handler.codec.dns
Interface DnsResponse
- All Superinterfaces:
DnsMessage
,ReferenceCounted
- All Known Implementing Classes:
DatagramDnsResponse
,DefaultDnsResponse
A DNS response message.
-
Method Summary
Modifier and TypeMethodDescriptionaddRecord
(DnsSection section, int index, DnsRecord record) Adds the specifiedrecord
at the specifiedindex
of the specifiedsection
of this DNS message.addRecord
(DnsSection section, DnsRecord record) Adds the specifiedrecord
at the end of the specifiedsection
of this DNS message.clear()
Removes all the records in this DNS message.clear
(DnsSection section) Removes all the records in the specifiedsection
of this DNS message.code()
Returns the 4 bit return code.boolean
Returnstrue
if responding server is authoritative for the domain name in the query message.boolean
Returnstrue
if DNS server can handle recursive queries.boolean
Returnstrue
if response has been truncated, usually if it is over 512 bytes.retain()
Increases the reference count by1
.retain
(int increment) Increases the reference count by the specifiedincrement
.setAuthoritativeAnswer
(boolean authoritativeAnswer) Set totrue
if responding server is authoritative for the domain name in the query message.setCode
(DnsResponseCode code) Sets the response code for this message.setId
(int id) Sets theID
of this DNS message.Sets theopCode
of this DNS message.setRecord
(DnsSection section, DnsRecord record) Sets the specifiedsection
of this DNS message to the specifiedrecord
, making it a single-record section.setRecursionAvailable
(boolean recursionAvailable) Set totrue
if DNS server can handle recursive queries.setRecursionDesired
(boolean recursionDesired) Sets theRD
(recursion desired} field of this DNS message.setTruncated
(boolean truncated) Set totrue
if response has been truncated (usually happens for responses over 512 bytes).setZ
(int z) Sets theZ
(reserved for future use) field of this DNS message.touch()
Records the current access location of this object for debugging purposes.Records the current access location of this object with an additional arbitrary information for debugging purposes.Methods inherited from interface io.netty.handler.codec.dns.DnsMessage
count, count, id, isRecursionDesired, opCode, recordAt, recordAt, removeRecord, setRecord, z
Methods inherited from interface io.netty.util.ReferenceCounted
refCnt, release, release
-
Method Details
-
isAuthoritativeAnswer
boolean isAuthoritativeAnswer()Returnstrue
if responding server is authoritative for the domain name in the query message. -
setAuthoritativeAnswer
Set totrue
if responding server is authoritative for the domain name in the query message.- Parameters:
authoritativeAnswer
- flag for authoritative answer
-
isTruncated
boolean isTruncated()Returnstrue
if response has been truncated, usually if it is over 512 bytes. -
setTruncated
Set totrue
if response has been truncated (usually happens for responses over 512 bytes).- Parameters:
truncated
- flag for truncation
-
isRecursionAvailable
boolean isRecursionAvailable()Returnstrue
if DNS server can handle recursive queries. -
setRecursionAvailable
Set totrue
if DNS server can handle recursive queries.- Parameters:
recursionAvailable
- flag for recursion availability
-
code
DnsResponseCode code()Returns the 4 bit return code. -
setCode
Sets the response code for this message.- Parameters:
code
- the response code
-
setId
Description copied from interface:DnsMessage
Sets theID
of this DNS message.- Specified by:
setId
in interfaceDnsMessage
-
setOpCode
Description copied from interface:DnsMessage
Sets theopCode
of this DNS message.- Specified by:
setOpCode
in interfaceDnsMessage
-
setRecursionDesired
Description copied from interface:DnsMessage
Sets theRD
(recursion desired} field of this DNS message.- Specified by:
setRecursionDesired
in interfaceDnsMessage
-
setZ
Description copied from interface:DnsMessage
Sets theZ
(reserved for future use) field of this DNS message.- Specified by:
setZ
in interfaceDnsMessage
-
setRecord
Description copied from interface:DnsMessage
Sets the specifiedsection
of this DNS message to the specifiedrecord
, making it a single-record section. When the specifiedsection
isDnsSection.QUESTION
, the specifiedrecord
must be aDnsQuestion
.- Specified by:
setRecord
in interfaceDnsMessage
-
addRecord
Description copied from interface:DnsMessage
Adds the specifiedrecord
at the end of the specifiedsection
of this DNS message. When the specifiedsection
isDnsSection.QUESTION
, the specifiedrecord
must be aDnsQuestion
.- Specified by:
addRecord
in interfaceDnsMessage
-
addRecord
Description copied from interface:DnsMessage
Adds the specifiedrecord
at the specifiedindex
of the specifiedsection
of this DNS message. When the specifiedsection
isDnsSection.QUESTION
, the specifiedrecord
must be aDnsQuestion
.- Specified by:
addRecord
in interfaceDnsMessage
-
clear
Description copied from interface:DnsMessage
Removes all the records in the specifiedsection
of this DNS message.- Specified by:
clear
in interfaceDnsMessage
-
clear
DnsResponse clear()Description copied from interface:DnsMessage
Removes all the records in this DNS message.- Specified by:
clear
in interfaceDnsMessage
-
touch
DnsResponse touch()Description copied from interface:ReferenceCounted
Records the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
. This method is a shortcut totouch(null)
.- Specified by:
touch
in interfaceDnsMessage
- Specified by:
touch
in interfaceReferenceCounted
-
touch
Description copied from interface:ReferenceCounted
Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector
.- Specified by:
touch
in interfaceDnsMessage
- Specified by:
touch
in interfaceReferenceCounted
-
retain
DnsResponse retain()Description copied from interface:ReferenceCounted
Increases the reference count by1
.- Specified by:
retain
in interfaceDnsMessage
- Specified by:
retain
in interfaceReferenceCounted
-
retain
Description copied from interface:ReferenceCounted
Increases the reference count by the specifiedincrement
.- Specified by:
retain
in interfaceDnsMessage
- Specified by:
retain
in interfaceReferenceCounted
-