DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
Interface |
|
Interface for something which can be encoded to and decoded to the DNS wire format. |
Interface |
|
Interface for DNS records that can be encoded and decoded. |
Interface |
|
A single entry in a zone of authority. |
Class |
|
No class docstring; 0/1 instance variable, 3/6 methods documented |
Class |
|
DNS protocol over UDP. |
Class |
|
DNS protocol mixin shared by UDP and TCP implementations. |
Class |
|
DNS protocol over TCP. |
Class |
|
Message contains all the information represented by a single DNS request or response. |
Class |
|
A name in the domain name system, made up of multiple labels. For example, twistedmatrix.com. |
Class |
|
Represent a single DNS query. |
Class |
|
An IPv4 host address. |
Class |
|
An IPv6 address. |
Class |
|
An IPv6 host address. |
Class |
|
Map from a domain name to the name of an AFS cell database server. |
Class |
|
The canonical name for an alias. |
Class |
|
A non-terminal DNS name redirection. |
Class |
|
Host information. |
Class |
|
A mailbox domain name. |
Class |
|
A mail destination. |
Class |
|
A mail forwarder. |
Class |
|
A mail group member. |
Class |
|
Mailbox or mail list information. |
Class |
|
A mail rename domain name. |
Class |
|
Mail exchange. |
Class |
|
The location of the server(s) for a specific protocol and domain. |
Class |
|
An authoritative nameserver. |
Class |
|
A null record. |
Class |
|
A domain name pointer. |
Class |
|
The responsible person for a domain. |
Class |
|
Marks the start of a zone of authority. |
Class |
|
Structurally, freeform text. Semantically, a policy definition, formatted as defined in rfc 4408. |
Class |
|
The location of the server(s) for a specific protocol and domain. |
Class |
|
A record containing the fingerprint of an SSH key. |
Class |
|
A transaction signature, encapsulated in a RR, as described in RFC 2845. |
Class |
|
Freeform text. |
Class |
|
A well known service description. |
Class |
|
A resource record header. |
Class |
|
A Resource Record which consists of a single RFC 1035 domain-name. |
Class |
|
Encapsulate the wire data for unknown record types so that they can pass through the system unchanged. |
Function | domain |
Coerce a domain name string to bytes. |
Function | random |
Wrapper around twisted.python.randbytes.RandomFactory.secureRandom to return 2 random bytes. |
Function | read |
Undocumented |
Function | str2time |
Parse a string description of an interval into an integer number of seconds. |
Constant | A6 |
Undocumented |
Constant | AAAA |
Undocumented |
Constant | ANY |
Undocumented |
Constant | DNAME |
Undocumented |
Constant | EBADVERSION |
Undocumented |
Constant | EXT |
Undocumented |
Constant | NAPTR |
Undocumented |
Constant | OP |
Undocumented |
Constant | OP |
Undocumented |
Constant | OPT |
Undocumented |
Constant | PORT |
Undocumented |
Constant | QUERY |
Undocumented |
Constant | QUERY |
Undocumented |
Constant | REV |
Undocumented |
Constant | REV |
Undocumented |
Constant | SPF |
Undocumented |
Constant | SRV |
Undocumented |
Constant | SSHFP |
Undocumented |
Constant | TKEY |
Undocumented |
Constant | TSIG |
Undocumented |
Variable | A |
Undocumented |
Variable | AFSDB |
Undocumented |
Variable | ALL |
Undocumented |
Variable | AXFR |
Undocumented |
Variable | CH |
Undocumented |
Variable | CNAME |
Undocumented |
Variable | CS |
Undocumented |
Variable | EBADKEY |
Undocumented |
Variable | EBADSIG |
Undocumented |
Variable | EBADTIME |
Undocumented |
Variable | EFORMAT |
Undocumented |
Variable | ENAME |
Undocumented |
Variable | ENOTIMP |
Undocumented |
Variable | EREFUSED |
Undocumented |
Variable | ESERVER |
Undocumented |
Variable | HINFO |
Undocumented |
Variable | HS |
Undocumented |
Variable | IN |
Undocumented |
Variable | IXFR |
Undocumented |
Variable | MAILA |
Undocumented |
Variable | MAILB |
Undocumented |
Variable | MB |
Undocumented |
Variable | MD |
Undocumented |
Variable | MF |
Undocumented |
Variable | MG |
Undocumented |
Variable | MINFO |
Undocumented |
Variable | MR |
Undocumented |
Variable | MX |
Undocumented |
Variable | NS |
Undocumented |
Variable | NULL |
Undocumented |
Variable | OK |
Undocumented |
Variable | OP |
Undocumented |
Variable | OP |
Undocumented |
Variable | OP |
Undocumented |
Variable | PTR |
Undocumented |
Variable | RP |
Undocumented |
Variable | SOA |
Undocumented |
Variable | TXT |
Undocumented |
Variable | WKS |
Undocumented |
Class | _ |
An EDNS message. |
Class | _ |
An OPT record header. |
Class | _ |
A class to represent OPT record variable options. |
Function | _compact |
Return a str representation of obj which only shows fields with non-default values, flags which are True and sections which have been explicitly set. |
Function | _get |
Inspect the function signature of obj's constructor, and get a list of which arguments should be displayed. This is a helper function for _compactRepr. |
Function | _is |
Test whether descendantName is equal to or is a subdomain of ancestorName. |
Function | _name |
Split a domain name into its constituent labels. |
Function | _nicebytes |
Represent a mostly textful bytes object in a way suitable for presentation to an end user. |
Function | _nicebyteslist |
Represent a list of mostly textful bytes objects in a way suitable for presentation to an end user. |
Function | _ord2bytes |
Construct a bytes object representing a single byte with the given ordinal value. |
Function | _response |
Generate a Message like instance suitable for use as the response to message. |
Function | _str2time |
mypy doesn't like type-punning str | bytes | int | None into a str so we have this helper function. |
Coerce a domain name string to bytes.
twisted.names
represents domain names as bytes
, but many interfaces accept bytes
or a text string (unicode
on Python 2, str
on Python 3). This function coerces text strings using IDNA encoding --- see encodings.idna
.
Note that DNS is case insensitive but case preserving. This function doesn't normalize case, so you'll still need to do that whenever comparing the strings it returns.
Parameters | |
domain:bytes or str | A domain name. If passed as a text string it will be idna encoded. |
Returns | |
bytes | bytes suitable for network transmission. |
Present Since | |
Twisted 20.3.0 |
Wrapper around twisted.python.randbytes.RandomFactory.secureRandom
to return 2 random bytes.
Returns | |
bytes | Undocumented |
Parse a string description of an interval into an integer number of seconds.
Parameters | |
s:text string (bytes or str ) for parsing; anything else for passthrough. | An interval definition constructed as an interval duration followed by an interval unit. An interval duration is a base ten representation of an integer. An interval unit is one of the following letters: S (seconds), M (minutes), H (hours), D (days), W (weeks), or Y (years). For example: "3S" indicates an interval of three seconds; "5D" indicates an interval of five days. Alternatively, s may be any non-string and it will be returned unmodified. |
Returns | |
Union[ | an int giving the interval represented by the string s, or whatever s is if it is not a string. |
Undocumented
Value |
|
object
, alwaysShow: Sequence[ str]|None
= None, flagNames: Sequence[ str]|None
= None, fieldNames: Sequence[ str]|None
= None, sectionNames: Sequence[ str]|None
= None) -> str
:
(source)
¶
Return a str
representation of obj which only shows fields with non-default values, flags which are True and sections which have been explicitly set.
Parameters | |
obj:object | The instance whose repr is being generated. |
alwaysSequence[ | A list of field names which should always be shown. |
flagSequence[ | A list of flag attribute names which should be shown if they are True . |
fieldSequence[ | A list of field attribute names which should be shown if they have non-default values. |
sectionSequence[ | A list of section attribute names which should be shown if they have been assigned a value. |
Returns | |
str | A str representation of obj. |
Inspect the function signature of obj's constructor, and get a list of which arguments should be displayed. This is a helper function for _compactRepr.
Parameters | |
obj | The instance whose repr is being generated. |
always | A list of field names which should always be shown. |
field | A list of field attribute names which should be shown if they have non-default values. |
Returns | |
A list of displayable arguments. |
Test whether descendantName is equal to or is a subdomain of ancestorName.
The names are compared case-insensitively.
The names are treated as byte strings containing one or more DNS labels separated by ..
descendantName is considered equal if its sequence of labels exactly matches the labels of ancestorName.
descendantName is considered a subdomain if its sequence of labels ends with the labels of ancestorName.
Parameters | |
descendantbytes | The DNS subdomain name. |
ancestorbytes | The DNS parent or ancestor domain name. |
Returns | |
True if descendantName is equal to or if it is a subdomain of ancestorName. Otherwise returns False. |
Represent a mostly textful bytes object in a way suitable for presentation to an end user.
Parameters | |
bytes | The bytes to represent. |
Returns | |
str | Undocumented |
Represent a list of mostly textful bytes objects in a way suitable for presentation to an end user.
Parameters | |
list | The list of bytes to represent. |
Returns | |
str | Undocumented |
Generate a Message
like instance suitable for use as the response to message.
The queries, id attributes will be copied from message and the answer flag will be set to True
.
Parameters | |
response | A response message constructor with an initializer signature matching dns.Message.__init__ . |
message:Message | A request message. |
**kwargs:dict | Keyword arguments which will be passed to the initialiser of the response message. |
Returns | |
responseConstructor | A Message like response instance. |