summaryrefslogtreecommitdiffhomepage
path: root/libs/dns/resolver.pyi
blob: 6da21f1255e845788789435067477745697c71ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from typing import Union, Optional, List, Any, Dict
from . import exception, rdataclass, name, rdatatype

import socket
_gethostbyname = socket.gethostbyname

class NXDOMAIN(exception.DNSException): ...
class YXDOMAIN(exception.DNSException): ...
class NoAnswer(exception.DNSException): ...
class NoNameservers(exception.DNSException): ...
class NotAbsolute(exception.DNSException): ...
class NoRootSOA(exception.DNSException): ...
class NoMetaqueries(exception.DNSException): ...
class NoResolverConfiguration(exception.DNSException): ...
Timeout = exception.Timeout

def resolve(qname : str, rdtype : Union[int,str] = 0,
            rdclass : Union[int,str] = 0,
            tcp=False, source=None, raise_on_no_answer=True,
            source_port=0, lifetime : Optional[float]=None,
            search : Optional[bool]=None):
    ...
def query(qname : str, rdtype : Union[int,str] = 0,
          rdclass : Union[int,str] = 0,
          tcp=False, source=None, raise_on_no_answer=True,
          source_port=0, lifetime : Optional[float]=None):
    ...
def resolve_address(self, ipaddr: str, *args: Any, **kwargs: Optional[Dict]):
    ...
class LRUCache:
    def __init__(self, max_size=1000):
        ...
    def get(self, key):
        ...
    def put(self, key, val):
        ...
class Answer:
    def __init__(self, qname, rdtype, rdclass, response,
                 raise_on_no_answer=True):
        ...
def zone_for_name(name, rdclass : int = rdataclass.IN, tcp=False,
                  resolver : Optional[Resolver] = None):
    ...

class Resolver:
    def __init__(self, filename : Optional[str] = '/etc/resolv.conf',
                 configure : Optional[bool] = True):
        self.nameservers : List[str]
    def resolve(self, qname : str, rdtype : Union[int,str] = rdatatype.A,
                rdclass : Union[int,str] = rdataclass.IN,
                tcp : bool = False, source : Optional[str] = None,
                raise_on_no_answer=True, source_port : int = 0,
                lifetime : Optional[float]=None,
                search : Optional[bool]=None):
        ...
    def query(self, qname : str, rdtype : Union[int,str] = rdatatype.A,
              rdclass : Union[int,str] = rdataclass.IN,
              tcp : bool = False, source : Optional[str] = None,
              raise_on_no_answer=True, source_port : int = 0,
              lifetime : Optional[float]=None):
        ...