Interface DnsResponse

All Superinterfaces:
DnsMessage, ReferenceCounted
All Known Implementing Classes:
DatagramDnsResponse, DefaultDnsResponse

public interface DnsResponse extends DnsMessage
A DNS response message.
  • Method Details

    • isAuthoritativeAnswer

      boolean isAuthoritativeAnswer()
      Returns true if responding server is authoritative for the domain name in the query message.
    • setAuthoritativeAnswer

      DnsResponse setAuthoritativeAnswer(boolean authoritativeAnswer)
      Set to true if responding server is authoritative for the domain name in the query message.
      Parameters:
      authoritativeAnswer - flag for authoritative answer
    • isTruncated

      boolean isTruncated()
      Returns true if response has been truncated, usually if it is over 512 bytes.
    • setTruncated

      DnsResponse setTruncated(boolean truncated)
      Set to true if response has been truncated (usually happens for responses over 512 bytes).
      Parameters:
      truncated - flag for truncation
    • isRecursionAvailable

      boolean isRecursionAvailable()
      Returns true if DNS server can handle recursive queries.
    • setRecursionAvailable

      DnsResponse setRecursionAvailable(boolean recursionAvailable)
      Set to true if DNS server can handle recursive queries.
      Parameters:
      recursionAvailable - flag for recursion availability
    • code

      Returns the 4 bit return code.
    • setCode

      Sets the response code for this message.
      Parameters:
      code - the response code
    • setId

      DnsResponse setId(int id)
      Description copied from interface: DnsMessage
      Sets the ID of this DNS message.
      Specified by:
      setId in interface DnsMessage
    • setOpCode

      DnsResponse setOpCode(DnsOpCode opCode)
      Description copied from interface: DnsMessage
      Sets the opCode of this DNS message.
      Specified by:
      setOpCode in interface DnsMessage
    • setRecursionDesired

      DnsResponse setRecursionDesired(boolean recursionDesired)
      Description copied from interface: DnsMessage
      Sets the RD (recursion desired} field of this DNS message.
      Specified by:
      setRecursionDesired in interface DnsMessage
    • setZ

      DnsResponse setZ(int z)
      Description copied from interface: DnsMessage
      Sets the Z (reserved for future use) field of this DNS message.
      Specified by:
      setZ in interface DnsMessage
    • setRecord

      DnsResponse setRecord(DnsSection section, DnsRecord record)
      Description copied from interface: DnsMessage
      Sets the specified section of this DNS message to the specified record, making it a single-record section. When the specified section is DnsSection.QUESTION, the specified record must be a DnsQuestion.
      Specified by:
      setRecord in interface DnsMessage
    • addRecord

      DnsResponse addRecord(DnsSection section, DnsRecord record)
      Description copied from interface: DnsMessage
      Adds the specified record at the end of the specified section of this DNS message. When the specified section is DnsSection.QUESTION, the specified record must be a DnsQuestion.
      Specified by:
      addRecord in interface DnsMessage
    • addRecord

      DnsResponse addRecord(DnsSection section, int index, DnsRecord record)
      Description copied from interface: DnsMessage
      Adds the specified record at the specified index of the specified section of this DNS message. When the specified section is DnsSection.QUESTION, the specified record must be a DnsQuestion.
      Specified by:
      addRecord in interface DnsMessage
    • clear

      DnsResponse clear(DnsSection section)
      Description copied from interface: DnsMessage
      Removes all the records in the specified section of this DNS message.
      Specified by:
      clear in interface DnsMessage
    • clear

      DnsResponse clear()
      Description copied from interface: DnsMessage
      Removes all the records in this DNS message.
      Specified by:
      clear in interface DnsMessage
    • 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 via ResourceLeakDetector. This method is a shortcut to touch(null).
      Specified by:
      touch in interface DnsMessage
      Specified by:
      touch in interface ReferenceCounted
    • touch

      DnsResponse touch(Object hint)
      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 via ResourceLeakDetector.
      Specified by:
      touch in interface DnsMessage
      Specified by:
      touch in interface ReferenceCounted
    • retain

      DnsResponse retain()
      Description copied from interface: ReferenceCounted
      Increases the reference count by 1.
      Specified by:
      retain in interface DnsMessage
      Specified by:
      retain in interface ReferenceCounted
    • retain

      DnsResponse retain(int increment)
      Description copied from interface: ReferenceCounted
      Increases the reference count by the specified increment.
      Specified by:
      retain in interface DnsMessage
      Specified by:
      retain in interface ReferenceCounted