class UnsupportedAlgorithm(dns.exception.DNSException):
"""The DNSSEC algorithm is not supported."""
- pass
class ValidationFailure(dns.exception.DNSException):
"""The DNSSEC signature is invalid."""
- pass
RSAMD5 = 1
DH = 2
class FormError(DNSException):
"""DNS message is malformed."""
- pass
class SyntaxError(DNSException):
"""Text input is malformed."""
- pass
class UnexpectedEnd(SyntaxError):
"""Text input ended unexpectedly."""
- pass
class TooBig(DNSException):
"""The DNS message is too big."""
- pass
class Timeout(DNSException):
"""The DNS operation timed out."""
- pass
class ShortHeader(dns.exception.FormError):
"""The DNS packet passed to from_wire() is too short."""
- pass
class TrailingJunk(dns.exception.FormError):
"""The DNS packet passed to from_wire() has extra junk at the end of it."""
- pass
class UnknownHeaderField(dns.exception.DNSException):
"""The header field name was not recognized when converting from text
into a message."""
- pass
class BadEDNS(dns.exception.FormError):
"""OPT record occured somewhere other than the start of
the additional data section."""
- pass
class BadTSIG(dns.exception.FormError):
"""A TSIG record occured somewhere other than the end of
the additional data section."""
- pass
class UnknownTSIGKey(dns.exception.DNSException):
"""A TSIG with an unknown key was received."""
- pass
class Message(object):
"""A DNS message.
class EmptyLabel(dns.exception.SyntaxError):
"""A DNS label is empty."""
- pass
class BadEscape(dns.exception.SyntaxError):
"""An escaped code in a text format of DNS name is invalid."""
- pass
class BadPointer(dns.exception.FormError):
"""A DNS compression pointer points forward instead of backward."""
- pass
class BadLabelType(dns.exception.FormError):
"""The label type in DNS name wire format is unknown."""
- pass
class NeedAbsoluteNameOrOrigin(dns.exception.DNSException):
"""An attempt was made to convert a non-absolute name to
wire when there was also a non-absolute (or missing) origin."""
- pass
class NameTooLong(dns.exception.FormError):
"""A DNS name is > 255 octets long."""
- pass
class LabelTooLong(dns.exception.SyntaxError):
"""A DNS label is > 63 octets long."""
- pass
class AbsoluteConcatenation(dns.exception.DNSException):
"""An attempt was made to append anything other than the
empty name to an absolute DNS name."""
- pass
class NoParent(dns.exception.DNSException):
"""An attempt was made to get the parent of the root name
or the empty name."""
- pass
class LabelMixesUnicodeAndASCII(dns.exception.SyntaxError):
"""Raised if a label mixes Unicode characters and ASCII escapes."""
class UnknownOpcode(dns.exception.DNSException):
"""An DNS opcode is unknown."""
- pass
def from_text(text):
"""Convert text into an opcode.
class UnexpectedSource(dns.exception.DNSException):
"""A DNS query response came from an unexpected address or port."""
- pass
class BadResponse(dns.exception.FormError):
"""A DNS query response does not respond to the question asked."""
- pass
def _compute_expiration(timeout):
if timeout is None:
class UnknownRcode(dns.exception.DNSException):
"""A DNS rcode is unknown."""
- pass
def from_text(text):
"""Convert text into an rcode.
class UnknownRdataclass(dns.exception.DNSException):
"""A DNS class is unknown."""
- pass
def from_text(text):
"""Convert text into a DNS rdata class value.
class DifferingCovers(dns.exception.DNSException):
"""An attempt was made to add a DNS SIG/RRSIG whose covered type
is not the same as that of the other rdatas in the rdataset."""
- pass
class IncompatibleTypes(dns.exception.DNSException):
"""An attempt was made to add DNS RR data of an incompatible type."""
- pass
class Rdataset(dns.set.Set):
"""A DNS rdataset.
class UnknownRdatatype(dns.exception.DNSException):
"""DNS resource record type is unknown."""
- pass
def from_text(text):
"""Convert text into a DNS rdata type value.
Note: although CNAME is officially a singleton type, dnspython allows
non-singleton CNAME rdatasets because such sets have been commonly
used by BIND and other nameservers for load balancing."""
- pass
class DLV(dns.rdtypes.dsbase.DSBase):
"""DLV record"""
- pass
class DS(dns.rdtypes.dsbase.DSBase):
"""DS record"""
- pass
class MX(dns.rdtypes.mxbase.MXBase):
"""MX record"""
- pass
class NS(dns.rdtypes.nsbase.NSBase):
"""NS record"""
- pass
class PTR(dns.rdtypes.nsbase.NSBase):
"""PTR record"""
- pass
class BadSigTime(dns.exception.DNSException):
"""Time in DNS SIG or RRSIG resource record cannot be parsed."""
- pass
def sigtime_to_posixtime(what):
if len(what) != 14:
class RT(dns.rdtypes.mxbase.UncompressedDowncasingMX):
"""RT record"""
- pass
"""SPF record
@see: RFC 4408"""
- pass
class TXT(dns.rdtypes.txtbase.TXTBase):
"""TXT record"""
- pass
class KX(dns.rdtypes.mxbase.UncompressedMX):
"""KX record"""
- pass
class NSAP_PTR(dns.rdtypes.nsbase.UncompressedNS):
"""NSAP-PTR record"""
- pass
class NXDOMAIN(dns.exception.DNSException):
"""The DNS query name does not exist."""
- pass
class YXDOMAIN(dns.exception.DNSException):
"""The DNS query name is too long after DNAME substitution."""
- pass
# The definition of the Timeout exception has moved from here to the
# dns.exception module. We keep dns.resolver.Timeout defined for
class NotAbsolute(dns.exception.DNSException):
"""An absolute domain name is required but a relative name was provided."""
- pass
class NoRootSOA(dns.exception.DNSException):
"""There is no SOA RR at the DNS root name. This should never happen!"""
- pass
class NoMetaqueries(dns.exception.DNSException):
"""DNS metaqueries are not allowed."""
class UngetBufferFull(dns.exception.DNSException):
"""An attempt was made to unget a token when the unget buffer was full."""
- pass
class Token(object):
"""A DNS master file format token.
class BadTime(dns.exception.DNSException):
"""The current time is not within the TSIG's validity time."""
- pass
class BadSignature(dns.exception.DNSException):
"""The TSIG signature fails to verify."""
- pass
class PeerError(dns.exception.DNSException):
"""Base class for all TSIG errors generated by the remote peer"""
- pass
class PeerBadKey(PeerError):
"""The peer didn't know the key we used"""
- pass
class PeerBadSignature(PeerError):
"""The peer didn't like the signature we sent"""
- pass
class PeerBadTime(PeerError):
"""The peer didn't like the time we sent"""
- pass
class PeerBadTruncation(PeerError):
"""The peer didn't like amount of truncation in the TSIG we sent"""
- pass
# TSIG Algorithms
class BadZone(dns.exception.DNSException):
"""The DNS zone is malformed."""
- pass
class NoSOA(BadZone):
"""The DNS zone has no SOA RR at its origin."""
- pass
class NoNS(BadZone):
"""The DNS zone has no NS RRset at its origin."""
- pass
class UnknownOrigin(BadZone):
"""The DNS zone's origin is unknown."""
- pass
class Zone(object):
"""A DNS zone.