java.lang.Object
org.minidns.dnsmessage.Question
A DNS question (request).
Field Summary
Modifier and TypeFieldDescriptionprivate byte[]Cache for the serialized object.final Record.CLASSThe question class (usually IN for Internet).final DnsNameThe question string (e.g.final Record.TYPEThe question type (e.g.private final booleanUnicastQueries have the highest bit of the CLASS field set to 1.Constructor Summary
ConstructorsConstructorDescriptionQuestion(DataInputStream dis, byte[] data) Parse a byte array and rebuild the dns question from it.Question(CharSequence name, Record.TYPE type) Create a dns question for the given name/type/IN (internet class).Question(CharSequence name, Record.TYPE type, Record.CLASS clazz) Create a dns question for the given name/type/class.Question(CharSequence name, Record.TYPE type, Record.CLASS clazz, boolean unicastQuery) Create a dns question for the given name/type/class.Question(DnsName name, Record.TYPE type) Create a dns question for the given name/type/IN (internet class).Question(DnsName name, Record.TYPE type, Record.CLASS clazz) Create a dns question for the given name/type/class.Question(DnsName name, Record.TYPE type, Record.CLASS clazz, boolean unicastQuery) Create a question from its components.Method Summary
Field Details
name
The question string (e.g. "measite.de").type
The question type (e.g. A).clazz
The question class (usually IN for Internet).unicastQuery
private final boolean unicastQueryUnicastQueries have the highest bit of the CLASS field set to 1.byteArray
private byte[] byteArrayCache for the serialized object.
Constructor Details
Question
Create a dns question for the given name/type/class.- Parameters:
name- The name e.g. "measite.de".type- The type, e.g. A.clazz- The class, usually IN (internet).unicastQuery- True if this is a unicast query.
Question
Create a question from its components.- Parameters:
name- the DNS nametype- the record typeclazz- the class, usually IN (internet); must not be nullunicastQuery- true for unicast query
Question
Create a dns question for the given name/type/class.- Parameters:
name- The name e.g. "measite.de".type- The type, e.g. A.clazz- The class, usually IN (internet).
Question
Create a dns question for the given name/type/IN (internet class).- Parameters:
name- The name e.g. "measite.de".type- The type, e.g. A.
Question
Create a dns question for the given name/type/class.- Parameters:
name- The name e.g. "measite.de".type- The type, e.g. A.clazz- The class, usually IN (internet).
Question
Create a dns question for the given name/type/IN (internet class).- Parameters:
name- The name e.g. "measite.de".type- The type, e.g. A.
Question
Parse a byte array and rebuild the dns question from it.- Parameters:
dis- The input stream.data- The plain data (for dns name references).- Throws:
IOException- On errors (read outside of packet).
Method Details
toByteArray
public byte[] toByteArray()Generate a binary packet for this dns question.- Returns:
- The dns question.
hashCode
equals
toString
asMessageBuilder
Wrap this question in a DnsMessage builder.- Returns:
- a new DnsMessage builder with this question set
asQueryMessage
Build a standalone query message holding this question.- Returns:
- a new DnsMessage with this question set