Home | Trees | Indices | Help |
|
---|
|
object --+ | Message
A DNS message.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
Two messages are equal if they have the same content in the header, question, answer, and authority sections. Returns a ``bool``. |
x.__init__(...) initializes x; see help(type(x)) for signature
|
repr(x)
|
str(x)
|
Find the RRset with the given attributes in the specified section. *section*, an ``int`` section number, or one of the section attributes of this message. This specifies the the section of the message to search. For example: my_message.find_rrset(my_message.answer, name, rdclass, rdtype) my_message.find_rrset(dns.message.ANSWER, name, rdclass, rdtype) *name*, a ``dns.name.Name``, the name of the RRset. *rdclass*, an ``int``, the class of the RRset. *rdtype*, an ``int``, the type of the RRset. *covers*, an ``int`` or ``None``, the covers value of the RRset. The default is ``None``. *deleting*, an ``int`` or ``None``, the deleting value of the RRset. The default is ``None``. *create*, a ``bool``. If ``True``, create the RRset if it is not found. The created RRset is appended to *section*. *force_unique*, a ``bool``. If ``True`` and *create* is also ``True``, create a new RRset regardless of whether a matching RRset exists already. The default is ``False``. This is useful when creating DDNS Update messages, as order matters for them. Raises ``KeyError`` if the RRset was not found and create was ``False``. Returns a ``dns.rrset.RRset object``. |
Get the RRset with the given attributes in the specified section. If the RRset is not found, None is returned. *section*, an ``int`` section number, or one of the section attributes of this message. This specifies the the section of the message to search. For example: my_message.get_rrset(my_message.answer, name, rdclass, rdtype) my_message.get_rrset(dns.message.ANSWER, name, rdclass, rdtype) *name*, a ``dns.name.Name``, the name of the RRset. *rdclass*, an ``int``, the class of the RRset. *rdtype*, an ``int``, the type of the RRset. *covers*, an ``int`` or ``None``, the covers value of the RRset. The default is ``None``. *deleting*, an ``int`` or ``None``, the deleting value of the RRset. The default is ``None``. *create*, a ``bool``. If ``True``, create the RRset if it is not found. The created RRset is appended to *section*. *force_unique*, a ``bool``. If ``True`` and *create* is also ``True``, create a new RRset regardless of whether a matching RRset exists already. The default is ``False``. This is useful when creating DDNS Update messages, as order matters for them. Returns a ``dns.rrset.RRset object`` or ``None``. |
Is this message a response to *other*? Returns a ``bool``. |
Return the opcode. Returns an ``int``. |
Return the rcode. Returns an ``int``. |
Return the "section number" of the specified section for use in indexing. The question section is 0, the answer section is 1, the authority section is 2, and the additional section is 3. *section* is one of the section attributes of this message. Raises ``ValueError`` if the section isn't known. Returns an ``int``. |
Return the "section number" of the specified section for use in indexing. The question section is 0, the answer section is 1, the authority section is 2, and the additional section is 3. *section* is one of the section attributes of this message. Raises ``ValueError`` if the section isn't known. Returns an ``int``. |
Set the opcode. *opcode*, an ``int``, is the opcode to set. |
Set the rcode. *rcode*, an ``int``, is the rcode to set. |
Convert the message to text. The *origin*, *relativize*, and any other keyword arguments are passed to the RRset ``to_wire()`` method. Returns a ``text``. |
Return a string containing the message in DNS compressed wire format. Additional keyword arguments are passed to the RRset ``to_wire()`` method. *origin*, a ``dns.name.Name`` or ``None``, the origin to be appended to any relative names. *max_size*, an ``int``, the maximum size of the wire format output; default is 0, which means "the message's request payload, if nonzero, or 65535". Raises ``dns.exception.TooBig`` if *max_size* was exceeded. Returns a ``binary``. |
Configure EDNS behavior. *edns*, an ``int``, is the EDNS level to use. Specifying ``None``, ``False``, or ``-1`` means "do not use EDNS", and in this case the other parameters are ignored. Specifying ``True`` is equivalent to specifying 0, i.e. "use EDNS0". *ednsflags*, an ``int``, the EDNS flag values. *payload*, an ``int``, is the EDNS sender's payload field, which is the maximum size of UDP datagram the sender can handle. I.e. how big a response to this message can be. *request_payload*, an ``int``, is the EDNS payload size to use when sending this message. If not specified, defaults to the value of *payload*. *options*, a list of ``dns.edns.Option`` objects or ``None``, the EDNS options. |
When sending, a TSIG signature using the specified keyring and keyname should be added. See the documentation of the Message class for a complete description of the keyring dictionary. *keyring*, a ``dict``, the TSIG keyring to use. If a *keyring* is specified but a *keyname* is not, then the key used will be the first key in the *keyring*. Note that the order of keys in a dictionary is not defined, so applications should supply a keyname when a keyring is used, unless they know the keyring contains only one key. *keyname*, a ``dns.name.Name`` or ``None``, the name of the TSIG key to use; defaults to ``None``. The key must be defined in the keyring. *fudge*, an ``int``, the TSIG time fudge. *original_id*, an ``int``, the TSIG original id. If ``None``, the message's id is used. *tsig_error*, an ``int``, the TSIG error code. *other_data*, a ``binary``, the TSIG other data. *algorithm*, a ``dns.name.Name``, the TSIG algorithm to use. |
Enable or disable 'DNSSEC desired' flag in requests. *wanted*, a ``bool``. If ``True``, then DNSSEC data is desired in the response, EDNS is enabled if required, and then the DO bit is set. If ``False``, the DO bit is cleared if EDNS is enabled. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Dec 8 10:59:55 2018 | http://epydoc.sourceforge.net |