+\h#dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddlmZmZmZmZmZmZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl!Zddl"ZdZ#dZ$ejJjMdZ'e'rUddl(Z)ddl*Z*e)jVZ,e)jZj\j^Z0Gdde,Z1Gd d e*jdZ3n Gd d Z3e'Z4 ddl5Z5e jZ7GddejpjrZ:GddejpjvZ<GddejpjrZ=GddejpjrZ>ej~jZ@dZAdZBdZCdZDdZEdZF drdZGdsdZHded d!d fd"ZIGd#d$ejZKdd%ddd&d&dd'dddde jeKjfd(ejjd)ePd*eeQd+eRd,eePd-eRd.eSd/eSd0eed1ePd2eSd3eePd4eeSePfded d5eRd6eKd!ejjf"d7ZTd8ejjd9eWd!eWfd:ZXd8ejjd;ePdePd*eeQd+eRd,eePd-eRd.eSd/eSd4eeSePfd?eePd2eSd!ejjfd@ZZdAZ[dBZ\ dudCedDeejjeWfdEedFeeQd!eeReQff dGZ] dvdCedEeedFeeQdHeSd.eSdIeeejjejjfdJeeWd/eSdKeSdLeSdMeejjd!efdNZb dwd(ejjd)ePd*eeQd+eRd,eePd-eRdHeSd.eSd/eSdKeSdCeedLeSd!ejjfdPZc dxd(ejjd)ePd*eeQd+eRd,eePd-eRdHeSd.eSd/eSdQeedReedLeSd!eejjeSffdSZddTZedUZf dudCedDeejjeWfdFeeQd!eeReQffdVZg dydCedFeeQd.eSdIeeejjejjfdJeeWd/eSd!eejjeQffdWZhdXZi dzd(ejjd)ePd*eeQd+eRd,eePd-eRd.eSd/eSdCeed!ejjfdYZjdZZkd[eePd4eeSePfd!e5jfd\Zm d{d(ejjd)ePd*eeQd+eRd,eePd-eRd.eSd/eSdCee5jd]ee5jd[eePd4eeSePfd!ejjfd^Zo d|d(ejjd)ePd*eeQd+eRd,eePd-eRd.eSd/eSd_eejjd4eeSePfd?eePd[eePd!ejjfd`ZUGdadbejZqdcejjdde jdMejjdeeeRd*eeQdFeQd!efdfZtejjejjddOdddddddd&ejjf d)ePdgeejjePfdheejjePfdieejjePfd*eeQd+eRdIeeejjejjfdjeeejjePfdkeSdleeQd,eePd-eRdeeRdmeSdneejjePfd!ef doZ?ddOddddeqjfd)ePdcejjdMeejjd+eRd*eeQdleeQd,eePd-eRdpeqd!dfdqZ}y#e6$rGd d Z5Y\wxYw)}zTalk to a DNS server.N)AnyDictOptionalTupleUnioncastcx|y|tjz }|dkrtjj|S)N)timedns exceptionTimeout) expirationtimeouts L/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/dns/query.py _remainingr1s7499;&G#~mm### NcJ|yttj|z|SN)minr )rrs r_expiration_for_this_attemptr:s# tyy{W$j 11rdohc2eZdZfdZ ddZ ddZxZS)_NetworkBackendcZt|||_||_||_||_yr)super__init__ _local_port _resolver_bootstrap_address_family)selfresolver local_portbootstrap_addressfamily __class__s rrz_NetworkBackend.__init__Is, G  )D %DN&7D #!DLrclg}t|\}}tjj|r|j |n|j |j |j nft |}|j} |rtjj|} |jj|| |} | j}|D]} tjj| } ||jdk7r-tjj||jf| } nd} t| tj | }t#d|} t%|tjj| |f| |t'|cSt*j,#t($rYwxYw)N)r&lifetimerg@)_compute_timesr inet is_addressappendr rr!af_for_addressr resolve_name addressesrlow_level_address_tuple _make_socketsocket SOCK_STREAMr_connect_CoreSyncStream Exceptionhttpcore ConnectError)r"hostportr local_addresssocket_optionsr0_rr&answersaddressafsourcesockattempt_expirations r connect_tcpz_NetworkBackend.connect_tcpPsI*73MAzxx""4(  &((4  !8!89$Z0  XX44]CF..55'6$--/ $ XX,,W5 ,0@0@A0E XX==&(8(892F"F#B(:(:FC%A#z%R"88'4"M* +400! &'' '!s7F'' F32F3ctrNotImplementedError)r"pathrr=s rconnect_unix_socketz#_NetworkBackend.connect_unix_socketws & %rr)__name__ __module__ __qualname__rrErJ __classcell__r's@rrrHs "FJ% (P15 &rrc>eZdZdddejdfd ZxZS)_HTTPTransportrN)r$r%r#r&c| |ddl}|jj}t||i|t |||||j _yNr) dns.resolverr#Resolverrrr_pool_network_backend) r"r$r%r#r&argskwargsr r's rrz_HTTPTransport.__init__}sS$5$=#<<002 G d -f -*9*&7+DJJ 'r)rKrLrMr3 AF_UNSPECrrNrOs@rrQrQ|s!"##   rrQceZdZdZy)rQctrrG)r"r:r;rr<s rrEz_HTTPTransport.connect_tcp% %rN)rKrLrMrErrrQrQs &rcteZdZdZGddeZGddeZGddZGdd Ze d Z y ) sslrc eZdZy)ssl.WantReadExceptionNrKrLrMr^rrWantReadExceptionrb rrdc eZdZy)ssl.WantWriteExceptionNrcr^rrWantWriteExceptionrgrerrhc eZdZy)ssl.SSLContextNrcr^rr SSLContextrjrerrkc eZdZy) ssl.SSLSocketNrcr^rr SSLSocketrmrerrnctd)Nzno ssl support)r7)clsrXrYs rcreate_default_contextzssl.create_default_contexts,- -rN) rKrLrM CERT_NONEr7rdrhrkrn classmethodrqr^rrr`r`sG            .  .rr`ceZdZdZy)UnexpectedSourcez=A DNS query response came from an unexpected address or port.NrKrLrM__doc__r^rrrurusGrruceZdZdZy) BadResponsezrseleventsrs r _wait_forrsJr3==1bjjlQ6F  # # %C F)&&&)'''  R tyy{* c>--'' ' ::g mm### rc"t|ddd|y)NTFrsrs r_wait_for_readablers audJ/rc"t|ddd|y)NFTrrs r_wait_for_writablers adJ/rc tjj||d}tjj||d}||k(xr |dd|ddk(S#tjj$rYywxYw)NrF)r r+ inet_ptonr SyntaxError)rAa1a2n1n2s r_addresses_equalrs{ XX  BqE * XX  BqE * 8 (12"QR&(( == $ $sAAA:9A:c|syt|||s-tjj|dr |dd|ddk(ry|ryt d|d|)NTrrFzgot a response from z instead of )rr r+ is_multicastru)rA from_address destinationignore_unexpecteds r_matches_destinationrsh L+6 k!n-,qr2BkRSRTo2U   |nL[MJ rTcd}d} tjj|}|}|r3tjj|}|r||k7r t d|}|r"|s tjj |}|r"tjj ||f|}|r"tjj ||f|}|||fS#t$r|rYwxYw#t$r t dwxYw)Nz5different address families for source and destinationz3source_port specified but address family is unknown)r r+r.r7 ValueError any_for_afr1)wherer;rB source_portwhere_must_be_addressrArsafs r_destination_and_sourcers  BK XX $ $U + hh%%f- by K B6 TXX((,F hh66 T7JBO  116;2GL  V $$?   !, TRS S Ts!C !C CCC4ct||} |jd||j||r|j|d|S|S#t$r|j wxYw)NF)do_handshake_on_connectserver_hostname)socket_factory setblockingbind wrap_socketr7close)rAtyperB ssl_contextrrs rr2r2@svr4 A e   FF6N **(- /+  H    s9A A A%r#zdns.resolver.ResolverreturncF|ddl}|jj}|SrS)rTr#rU)r#r s r_maybe_get_resolverrTs$ <<((* Orc,eZdZdZdZdZdZdZdZdZ dZ y) HTTPVersionzWhich version of HTTP should be used? DEFAULT will select the first version from the list [2, 1.1, 3] that is available. rrN) rKrLrMrwDEFAULTHTTP_1H1HTTP_2H2HTTP_3H3r^rrrrbs, G F B F B F BrriFz /dns-queryqrrr;rBrone_rr_per_rrsetignore_trailingsessionrIpostr%verifyr& http_versionc t||||d\}}}|[tjj|r<|tj k(r d|d|| }n |tj k(r d|d|| }n|}i}| tjj}|j tdtjj|jr|j} |j|d<|j |j}|tjk(s|tjk(rt sy| at#| } jJ| j%|j|}t'j(t+|j-} t/|| ||||||| | St st0|r%t3|t4j6s td |j9}d d i}|tj:tjfv}|tj<tjfv}|d}d }n |d }|d}|rt?j@|}n,tC|||| || | |}t5j6||| |}|5}| r=|jEd tGtI|d|jK||||}nLtMjN|jQd}|jS} |jU||d| i|}dddjVdks|jVdkDr't|d|jVd|jXtjZj]|jX|j^|j`||}!|jbje|!_3|ji|!stj|!S#1swYxYw)a Return the response obtained after sending a query via DNS-over-HTTPS. *q*, a ``dns.message.Message``, the query to send. *where*, a ``str``, the nameserver IP address or the full URL. If an IP address is given, the URL will be constructed using the following schema: https://:/. *timeout*, a ``float`` or ``None``, the number of seconds to wait before the query times out. If ``None``, the default, wait forever. *port*, a ``int``, the port to send the query to. The default is 443. *source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source address. The default is the wildcard address. *source_port*, an ``int``, the port from which to send the message. The default is 0. *one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset. *ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the received message. *session*, an ``httpx.Client``. If provided, the client session to use to send the queries. *path*, a ``str``. If *where* is an IP address, then *path* will be used to construct the URL to send the DNS query to. *post*, a ``bool``. If ``True``, the default, POST method will be used. *bootstrap_address*, a ``str``, the IP address to use to bypass resolution. *verify*, a ``bool`` or ``str``. If a ``True``, then TLS certificate verification of the server is done using the default CA bundle; if ``False``, then no verification is done; if a `str` then it specifies the path to a certificate file or directory which will be used for verification. *resolver*, a ``dns.resolver.Resolver`` or ``None``, the resolver to use for resolution of hostnames in URLs. If not specified, a new resolver with a default configuration will be used; note this is *not* the default resolver as that resolver might have been configured to use DoH causing a chicken-and-egg problem. This parameter only has an effect if the HTTP library is httpx. *family*, an ``int``, the address family. If socket.AF_UNSPEC (the default), both A and AAAA records will be retrieved. *http_version*, a ``dns.query.HTTPVersion``, indicating which HTTP version to use. Returns a ``dns.message.Message``. FNzhttps://:z https://[z]:zno hostname in URL sni_hostname)rrz)session parameter must be an httpx.Clientacceptzapplication/dns-messagerr)r<http1http2rr$r%r#r&)rrr transport)z content-typezcontent-length)headerscontentr extensions=r )rrparamsr+ responded with status code z Response body: keyring request_macrr)6rr r+r,r3AF_INETAF_INET6urllibparseurlparsehostnamerr;rrrhave_dohrr/randomchoicelistr0_http3r{rhttpxClientto_wirerr contextlib nullcontextrQupdatestrlenrbase64urlsafe_b64encoderstripdecodeget status_codermessage from_wirerrelapsed total_secondsr is_responsery)"rrrr;rBrrrrrIrr%rr#r&rrAr> the_sourceurlrparsedr?wirerh1h2r<r$cmrresponsetwirers" rhttpsrrsN2 tV[%RJ ~#((--e4  UG1TF4&1C 6?? "eWBtfTF3CJ &&s+ ?? "12 2 88  v / & )/J~ & ;; ";;D{~~% +++H  $*84H??. ..++FOOVDG & d73D3D3F.G H             z'5<<8DEE 99;D23G +..+*=*=> >B +..+*=*=> >B  "1 ] 0:0F0Fw0O"'!/  \\"Vy Q w  NN$=&)#d)n  ||% $H++D188>DKKME{{u~% #H)<c!X%9%9C%?g1(2F2F1G 0 01 3    MM)'  A   + + -AF ==  H[s B O##O,rnamecD|t|D]\}}||k(s |cStr)KeyError)rrheadervalues r _find_headerr 9s2   T>L Nrpeerrc t|d}| tdt|}|dkr td|dks|dkDr6d}t|dkDr d|j z}t |d ||y#t $rYwxYw) Ns:statuszno :status header in responserzstatus is negativerrz: r)r rintrrr7r)rrrr statuserrors r _check_statusrBs * -E }9:: ZF z.// |v| t9q= t{{},D6!=fXeWMNN$   sA66 BBrrc tjjs tdtj j |} | j} | j | j}d|_ |j} tjj| | d}|5|j||||}t|\}}|j|5}|j|| | |j!t#|} t%|j'|| dddt)j(}dddtj*j-| |j.|j0||}t3z d|_|j5|st6|S#1swYxYw#1swYzxYw)Nz DNS-over-HTTP3 is not available.rT) verify_mode server_nameh3rr )r quic have_quicr{rrrrr;idrSyncQuicManagerconnectr* make_streamsend_h3receiverrrr rrrrmaxrry)rrrrr;rBrrrrrr url_partsrmanager connectionstartrstreamfinishrs rrrSs 88  677 %%c*I!!H~~!~~ AD 99;Dhh&&T'G __UD&+F ,W5  # #G , 9 NN3d +>>*Z"89D &..*E4 8 9   MM)'  A% %AF ==  H 9 9s%$4F6A F*!F6*F3 /F66F?c` |j|S#t$rt||YnwxYw.)zReads a datagram from the socket. A Timeout exception will be raised if the operation is not completed by the expiration time. )recvfromBlockingIOErrorr)rCmax_sizers r _udp_recvr,s9  1==* * 1 tZ 0 1 s ,,c |r|j||S|j|S#t$rt||YnwxYwB)zSends the specified datagram to destination over the socket. A Timeout exception will be raised if the operation is not completed by the expiration time. )sendtosendr*r)rCdatarrs r _udp_sendr1sL  1{{455yy& 1 tZ 0 1 s((AArCwhatrrct|tjjr|j }t j }t ||||}||fS)aSend a DNS message to the specified UDP socket. *sock*, a ``socket``. *what*, a ``bytes`` or ``dns.message.Message``, the message to send. *destination*, a destination tuple appropriate for the address family of the socket, specifying where to send the query. *expiration*, a ``float`` or ``None``, the absolute time at which a timeout exception should be raised. If ``None``, no timeout will occur. Returns an ``(int, float)`` tuple of bytes sent and the sent time. )rr rMessagerr r1)rCr2rr sent_timens rsend_udpr7sH,$ ++,||~ I$k:6A y>rrrrraise_on_truncation ignore_errorsqueryc d} t|d|\} } t|j| ||s*tj} tj j | |||||}| r| | j|sz|r|| fS|| | fS#tj j$r.}| r&| $| j|j sYd}~ʂd}~wt$r| rYۂwxYw)aRead a DNS message from a UDP socket. *sock*, a ``socket``. *destination*, a destination tuple appropriate for the address family of the socket, specifying where the message is expected to arrive from. When receiving a response, this would be where the associated query was sent. *expiration*, a ``float`` or ``None``, the absolute time at which a timeout exception should be raised. If ``None``, no timeout will occur. *ignore_unexpected*, a ``bool``. If ``True``, ignore responses from unexpected sources. *one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset. *keyring*, a ``dict``, the keyring to use for TSIG. *request_mac*, a ``bytes`` or ``None``, the MAC of the request (for TSIG). *ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the received message. *raise_on_truncation*, a ``bool``. If ``True``, raise an exception if the TC bit is set. Raises if the message is malformed, if network errors occur, of if there is a timeout. If *destination* is not ``None``, returns a ``(dns.message.Message, float)`` tuple of the received message and the received time. If *destination* is ``None``, returns a ``(dns.message.Message, float, tuple)`` tuple of the received message, the received time, and the address where the message arrived from. *ignore_errors*, a ``bool``. If various format errors or response mismatches occur, ignore them and keep listening for a valid response. The default is ``False``. *query*, a ``dns.message.Message`` or ``None``. If not ``None`` and *ignore_errors* is ``True``, check that the received message is a response to this query, and if not keep listening for a valid response. r)rrrrr8N) r,rr&r r rr Truncatedrr7)rCrrrrrrrr8r9r:rr received_timeres r receive_udpr@s| D (ujA|# KK{4E     %%'!1 /$7 &A6 U.u7H7H7K  }% %}l3 31{{$$ %))!))+6   s$%BC %#C CC C 5c |j} t||||\} }}t|\}}| rtj| }nt | t j|}|5}t|| ||t||||||j|j|| | | \}}||z |_ | s|j|st|cdddS#1swYnxYw J)aReturn the response obtained after sending a query via UDP. *q*, a ``dns.message.Message``, the query to send *where*, a ``str`` containing an IPv4 or IPv6 address, where to send the message. *timeout*, a ``float`` or ``None``, the number of seconds to wait before the query times out. If ``None``, the default, wait forever. *port*, an ``int``, the port send the message to. The default is 53. *source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source address. The default is the wildcard address. *source_port*, an ``int``, the port from which to send the message. The default is 0. *ignore_unexpected*, a ``bool``. If ``True``, ignore responses from unexpected sources. *one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset. *ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the received message. *raise_on_truncation*, a ``bool``. If ``True``, raise an exception if the TC bit is set. *sock*, a ``socket.socket``, or ``None``, the socket to use for the query. If ``None``, the default, a socket is created. Note that if a socket is provided, it must be a nonblocking datagram socket, and the *source* and *source_port* are ignored. *ignore_errors*, a ``bool``. If various format errors or response mismatches occur, ignore them and keep listening for a valid response. The default is ``False``. Returns a ``dns.message.Message``. N)rrr*rrr2r3 SOCK_DGRAMr7r@rmacr rry)rrrr;rBrrrrr8rCr9rrAr begin_timerrrrr>s rudprF&sp 99;D 7 tV[!Rf .g6Z 0:0F0Ft0L "f// 8 qD+z2(     II EE      M+q!1 ),  s &ACCudp_socktcp_sockc  t|||||||||d| | } | dfS#tjj$rt ||||||||| } | dfcYSwxYw)a|Return the response to the query, trying UDP first and falling back to TCP if UDP results in a truncated response. *q*, a ``dns.message.Message``, the query to send *where*, a ``str`` containing an IPv4 or IPv6 address, where to send the message. *timeout*, a ``float`` or ``None``, the number of seconds to wait before the query times out. If ``None``, the default, wait forever. *port*, an ``int``, the port send the message to. The default is 53. *source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source address. The default is the wildcard address. *source_port*, an ``int``, the port from which to send the message. The default is 0. *ignore_unexpected*, a ``bool``. If ``True``, ignore responses from unexpected sources. *one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset. *ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the received message. *udp_sock*, a ``socket.socket``, or ``None``, the socket to use for the UDP query. If ``None``, the default, a socket is created. Note that if a socket is provided, it must be a nonblocking datagram socket, and the *source* and *source_port* are ignored for the UDP query. *tcp_sock*, a ``socket.socket``, or ``None``, the connected socket to use for the TCP query. If ``None``, the default, a socket is created. Note that if a socket is provided, it must be a nonblocking connected stream socket, and *where*, *source* and *source_port* are ignored for the TCP query. *ignore_errors*, a ``bool``. If various format errors or response mismatches occur while listening for UDP, ignore them and keep listening for a valid response. The default is ``False``. Returns a (``dns.message.Message``, tcp) tuple where tcp is ``True`` if and only if TCP was used. TF)rFr rr=tcp) rrrr;rBrrrrrGrHr9rs rudp_with_fallbackrKsr              %  ;;            $  s4AAc d}|dkDr; |j|}|dk(r td|t|z}||z }|dkDr;|S#ttj f$rt ||Y/tj$rt||YOwxYw)zRead the specified number of bytes from sock. Keep trying until we either get the desired amount, or we hit EOF. A Timeout exception will be raised if the operation is not completed by the expiration time. rrEOF) recvEOFErrorrr*r`SSLWantReadErrorrSSLWantWriteErrorr)rCcountrrr6s r _net_readrSs A !) 1 % ACxuo% SVOE FA !) H  !5!56 1 tZ 0$$ 1 tZ 0 1s4A%B ,B  B cd}t|}||kr ||j||dz }||kryy#ttjf$rt ||Y/tj $rt||YOwxYw)zWrite the specified data to the socket. A Timeout exception will be raised if the operation is not completed by the expiration time. rN)rr/r*r`rQrrPr)rCr0rcurrentls r _net_writerWs~ G D A A+ 1 tyygh0 0G A+ !6!67 1 tZ 0## 1 tZ 0 1s3%A;A;:A;ct|tjjr|j d}nt |j dd|z}tj}t|||t ||fS)a{Send a DNS message to the specified TCP socket. *sock*, a ``socket``. *what*, a ``bytes`` or ``dns.message.Message``, the message to send. *expiration*, a ``float`` or ``None``, the absolute time at which a timeout exception should be raised. If ``None``, no timeout will occur. Returns an ``(int, float)`` tuple of bytes sent and the sent time. T)prepend_lengthrbig) rr rr4rrto_bytesr rW)rCr2rtcpmsgr5s rsend_tcpr]sk$$ ++,T2 T##Au-4 ItVZ( K ##rct|d|}tjd|\}t|||}tj} tj j |||||} | | fS)aRead a DNS message from a TCP socket. *sock*, a ``socket``. *expiration*, a ``float`` or ``None``, the absolute time at which a timeout exception should be raised. If ``None``, no timeout will occur. *one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset. *keyring*, a ``dict``, the keyring to use for TSIG. *request_mac*, a ``bytes`` or ``None``, the MAC of the request (for TSIG). *ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the received message. Raises if the message is malformed, if network errors occur, of if there is a timeout. Returns a ``(dns.message.Message, float)`` tuple of the received message and the received time. r!Hr)rSstructunpackr r rr) rCrrrrrldatarVrr>rs r receive_tcprcssB dAz *E ==u %DQ T1j )DIIKM  )'  A } rcP|j|}|dk(ry|tjtjtjfvr:t |||j tjtj}|dk7rt|tj|yrS) connect_exerrno EINPROGRESS EWOULDBLOCKEALREADYr getsockoptr3 SOL_SOCKETSO_ERROROSErrorosstrerror)rr@rerrs rr5r5Ks ,,w C ax u  %"3"3U^^DD1j)ll6,,foo> axc2;;s+,,rc |j} t|\} } |rtj|} n-t ||||\} }}t | t j|} | 5}|s t|| t|| | t|| ||j|j|\}}|| z |_ |j|st|cdddS#1swYnxYw J)aReturn the response obtained after sending a query via TCP. *q*, a ``dns.message.Message``, the query to send *where*, a ``str`` containing an IPv4 or IPv6 address, where to send the message. *timeout*, a ``float`` or ``None``, the number of seconds to wait before the query times out. If ``None``, the default, wait forever. *port*, an ``int``, the port send the message to. The default is 53. *source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source address. The default is the wildcard address. *source_port*, an ``int``, the port from which to send the message. The default is 0. *one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset. *ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the received message. *sock*, a ``socket.socket``, or ``None``, the connected socket to use for the query. If ``None``, the default, a socket is created. Note that if a socket is provided, it must be a nonblocking connected stream socket, and *where*, *port*, *source* and *source_port* are ignored. Returns a ``dns.message.Message``. N)rr*rrrr2r3r4r5r]rcrrDr rry)rrrr;rBrrrrCrrErrrArrrr>s rrJrJVsV 99;D-g6Z 0:0F0Ft0L$; 4% ![&"f00& 9 q Q Z 0D*%( z+QYY M+}}Q      s &A&CCc |jy#tj$rt||Yn$tj$rt ||YnwxYwXr) do_handshaker`rPrrQrrs r_tls_handshakertsS  . NN  ## . q* -$$ . q* - . sAAArcd}d}t|trOtjj |r|}n-tjj |r|}n t dtj||}tjj|_ |d|_ |jdg|durtj|_|S)Nzinvalid verify string)cafilecapathFdot)rrrnrIisfileisdirrr`rq TLSVersionTLSv1_2minimum_versioncheck_hostnameset_alpn_protocolsrrr)rrrvrwrs r_make_dot_ssl_contextrs!F F&# 77>>& !F WW]]6 "F45 5,,F6JK"%.."8"8K%* """E7+ "%--  rrc |rt||||||||| S|j} t|\} }t||||\}}}| |s t | | } t |t j|| | 5}t|||t||t|| |t||||j|j|\}}|| z |_|j|st |cdddS#1swYnxYw J)akReturn the response obtained after sending a query via TLS. *q*, a ``dns.message.Message``, the query to send *where*, a ``str`` containing an IPv4 or IPv6 address, where to send the message. *timeout*, a ``float`` or ``None``, the number of seconds to wait before the query times out. If ``None``, the default, wait forever. *port*, an ``int``, the port send the message to. The default is 853. *source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source address. The default is the wildcard address. *source_port*, an ``int``, the port from which to send the message. The default is 0. *one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset. *ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the received message. *sock*, an ``ssl.SSLSocket``, or ``None``, the socket to use for the query. If ``None``, the default, a socket is created. Note that if a socket is provided, it must be a nonblocking connected SSL stream socket, and *where*, *port*, *source*, *source_port*, and *ssl_context* are ignored. *ssl_context*, an ``ssl.SSLContext``, the context to use when establishing a TLS connection. If ``None``, the default, creates one with the default configuration. *server_hostname*, a ``str`` containing the server's hostname. The default is ``None``, which means that no hostname is known, and if an SSL context is created, hostname checking will be disabled. *verify*, a ``bool`` or ``str``. If a ``True``, then TLS certificate verification of the server is done using the default CA bundle; if ``False``, then no verification is done; if a `str` then it specifies the path to a certificate file or directory which will be used for verification. Returns a ``dns.message.Message``. N)rr)rJrr*rrr2r3r4r5rtr]rcrrDr rry)rrrr;rBrrrrCrrrrrErrArrrr>s rtlsrs,z            99;D-g6Z 7 tV[!Rf4+OVD  '   K,q*%D*%( z+QYY M+}}Q !$  s 4A0C..C7r$c  tjjs td| | | } d|_|j } |rt jd} |}n#tjj| | } | }| 5|sj||||}t|\}}j|5}|j| d|jt|} dddtj}dddtj j#| |j$|j&||}t)z d|_|j+|st,|S#1swYxYw#1swYzxYw)aReturn the response obtained after sending a query via DNS-over-QUIC. *q*, a ``dns.message.Message``, the query to send. *where*, a ``str``, the nameserver IP address. *timeout*, a ``float`` or ``None``, the number of seconds to wait before the query times out. If ``None``, the default, wait forever. *port*, a ``int``, the port to send the query to. The default is 853. *source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source address. The default is the wildcard address. *source_port*, an ``int``, the port from which to send the message. The default is 0. *one_rr_per_rrset*, a ``bool``. If ``True``, put each RR into its own RRset. *ignore_trailing*, a ``bool``. If ``True``, ignore trailing junk at end of the received message. *connection*, a ``dns.quic.SyncQuicConnection``. If provided, the connection to use to send the query. *verify*, a ``bool`` or ``str``. If a ``True``, then TLS certificate verification of the server is done using the default CA bundle; if ``False``, then no verification is done; if a `str` then it specifies the path to a certificate file or directory which will be used for verification. *hostname*, a ``str`` containing the server's hostname or ``None``. The default is ``None``, which means that no hostname is known, and if an SSL context is created, hostname checking will be disabled. This value is ignored if *url* is not ``None``. *server_hostname*, a ``str`` or ``None``. This item is for backwards compatibility only, and has the same meaning as *hostname*. Returns a ``dns.message.Message``. zDNS-over-QUIC is not available.Nr)rrTrr )r rrr~rrrrrrr*rr/r rr rrrrr!rry)rrrr;rBrrrr$rrrrr#the_connection the_managerr%rr&r'rs rrr'shn 88  566"x'7" AD 99;D5?5K5KD5Q#((**v8*T (00fkRN,W5  ' ' 0 :F KKd #>>*Z"89D :   MM)'  A% %AF ==  H : : s$6E:8-E.%E:.E7 3E::FceZdZdZdZdZdZy)UDPModeaHow should UDP be used in an IXFR from :py:func:`inbound_xfr()`? NEVER means "never use UDP; always use TCP" TRY_FIRST means "try to use UDP but fall back to TCP if needed" ONLY means "raise ``dns.xfr.UseTCP`` if trying UDP does not succeed" rrrN)rKrLrMrwNEVER TRY_FIRSTONLYr^rrrrs EI Drr txn_managerrserialc #K|jdj}|tjjk(}|j }|j } |jtjk(} | rt|| d|n/tjdt| | z} t|| |tjj!|||| 5} d} d}| st#|\}}||||kDr|}| rt%|d|\}}n2t'|d|}tj(d|\}t'|||}tj*j-||j.|j0d||| |}| j3|} ||j4}| s|j.r+j6stj8j;d dddy#1swYyxYww) z'Given a socket, does the zone transfer.rNr_Fr<rT)rrxfrorigintsig_ctxmultirz missing TSIG)questionrdtyper rdatatypeIXFRfrom_wire_originrrr3rCr1r`packrrWrInboundr*r,rSrarrrrDprocess_messagerhad_tsigr FormError)rrr:rrrris_ixfrrris_udpr\inbounddonerr> mexpirationrwirerbrVrs r _inbound_xfrrs^^A  % %F ***G  ) ) +F ==?D VVv(( (F !T4,T3t9-41fj) fff =:-g6 Q "&;+C( &q%= !!Q 4}}T51!!Q 4 %% !II!!z!(& A**1-DGzzH12 ==--)).9 9;:::s%CG)CG7G G)G&"G)zonerrdclasskeyname relativizer)use_udp keyalgorithmc #2KGddtjj}t|trtj j |}tjjj|}tjj|||}|tjjk(r|j|j|tjj tjj"d}tj$j ddd| z}|j'|d||j)||| t+||| | \}}} t-| \}}|||}| r(|tjjk7r t/d | rt0j2nt0j4}t7||| 5}t9|||t;|||| ||Ed {d d d y 7 #1swYy xYww) aReturn a generator for the responses to a zone transfer. *where*, a ``str`` containing an IPv4 or IPv6 address, where to send the message. *zone*, a ``dns.name.Name`` or ``str``, the name of the zone to transfer. *rdtype*, an ``int`` or ``str``, the type of zone transfer. The default is ``dns.rdatatype.AXFR``. ``dns.rdatatype.IXFR`` can be used to do an incremental transfer instead. *rdclass*, an ``int`` or ``str``, the class of the zone transfer. The default is ``dns.rdataclass.IN``. *timeout*, a ``float``, the number of seconds to wait for each response message. If None, the default, wait forever. *port*, an ``int``, the port send the message to. The default is 53. *keyring*, a ``dict``, the keyring to use for TSIG. *keyname*, a ``dns.name.Name`` or ``str``, the name of the TSIG key to use. *relativize*, a ``bool``. If ``True``, all names in the zone will be relativized to the zone origin. It is essential that the relativize setting matches the one specified to ``dns.zone.from_xfr()`` if using this generator to make a zone. *lifetime*, a ``float``, the total number of seconds to spend doing the transfer. If ``None``, the default, then there is no limit on the time the transfer may take. *source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source address. The default is the wildcard address. *source_port*, an ``int``, the port from which to send the message. The default is 0. *serial*, an ``int``, the SOA serial number to use as the base for an IXFR diff sequence (only meaningful if *rdtype* is ``dns.rdatatype.IXFR``). *use_udp*, a ``bool``. If ``True``, use UDP (only meaningful for IXFR). *keyalgorithm*, a ``dns.name.Name`` or ``str``, the TSIG algorithm to use. Raises on errors, and so does the generator. Returns a generator of ``dns.message.Message`` objects. ceZdZdZdZdej jfdZdZ d de dejjfdZ y) $xfr..DummyTransactionManagerc^|||r!tjjf|_y|f|_yr)r remptyinfo)r"rrs rrz-xfr..DummyTransactionManager.__init__ s#zSXX^^VDIvVDIrc|jSr)rr"s rorigin_informationz7xfr..DummyTransactionManager.origin_information s 99 rrctrrGrs r get_classz.xfr..DummyTransactionManager.get_classr]rctrrGrs rreaderz+xfr..DummyTransactionManager.readerr]r replacementchGdd}ttjj|S)NceZdZdZdZy)Exfr..DummyTransactionManager.writer..DummyTransactioncyrr^)r"rXkws rnopzIxfr..DummyTransactionManager.writer..DummyTransaction.nopsrc|jSr)r)r"r>s r __getattr__zQxfr..DummyTransactionManager.writer..DummyTransaction.__getattr__s 88OrN)rKrLrMrrr^rrDummyTransactionrs $rr)rr transaction Transaction)r"rrs rwriterz+xfr..DummyTransactionManager.writers) $ $335E5GH HrN)F)rKrLrMrrr rdataclass RdataClassrrboolrrrr^rrDummyTransactionManagerr sH W  &s~~88 & & Id Is7R7R IrrT)createINSOAz. . %u 0 0 0 0rN) algorithmzcannot do a UDP AXFR)r rTransactionManagerrrr from_textr RdataTypemaker make_queryr find_rrset authorityrrrrdataadduse_tsigrr*rr3rCr4r2r5r)rrrrrr;rrrr)rBrrrrrrrrsetsoarArr>rtm sock_typers rrrsJI#//"D"DI.$xx!!$' ]] $ $ ) )& 1F tVW5A ### KKs~~00#--2C2CD ii!!$/?&/HI #q 7G| < 7 tV[!Rf%X.OQ z 2B6S]]////00%,!!&2D2DI b)V ,GK,Aq&':FFFGGFGGs0GH!H ;H <H  H H  HHudp_modec ,|#tjj|\}} ntjj|} t ||||\} } }t |\} } |j djtjjk(r\|tjk7rIt| tj|5}t|| |  t!|||| || D]}  dddyt| tj&|5}t|| | t!|||| || D]}  dddy#tjj"$r|tj$k(rYnwxYw ddd#1swYxYw#1swYyxYw)aConduct an inbound transfer and apply it via a transaction from the txn_manager. *where*, a ``str`` containing an IPv4 or IPv6 address, where to send the message. *txn_manager*, a ``dns.transaction.TransactionManager``, the txn_manager for this transfer (typically a ``dns.zone.Zone``). *query*, the query to send. If not supplied, a default query is constructed using information from the *txn_manager*. *port*, an ``int``, the port send the message to. The default is 53. *timeout*, a ``float``, the number of seconds to wait for each response message. If None, the default, wait forever. *lifetime*, a ``float``, the total number of seconds to spend doing the transfer. If ``None``, the default, then there is no limit on the time the transfer may take. *source*, a ``str`` containing an IPv4 or IPv6 address, specifying the source address. The default is the wildcard address. *source_port*, an ``int``, the port from which to send the message. The default is 0. *udp_mode*, a ``dns.query.UDPMode``, determines how UDP is used for IXFRs. The default is ``dns.UDPMode.NEVER``, i.e. only use TCP. Other possibilities are ``dns.UDPMode.TRY_FIRST``, which means "try UDP but fallback to TCP if needed", and ``dns.UDPMode.ONLY``, which means "try UDP and raise ``dns.xfr.UseTCP`` if it does not succeed. Raises on errors. Nr)r rrextract_serial_from_queryrr*rrrrrrr2r3rCr5rUseTCPrr4)rrr:r;rr)rBrrrrArr>rrs r inbound_xfrr9s^ }'',,[92259 7 tV[!Rf%X.OQ  ~~a3==#5#55(gmm:S "f// 8 A Q Z 0 %E67JA   b&,,f 5K,k1eVWjQ A   77>> w||+, +   s6E>D=#F =1E1.E>0E11E>>F F)T)NN) NUNrFFTNTr) NNFFNrFFFN) NrANrFFFFNF) NrANrFFFNNF)NFNrF)NrANrFFN) NrNrFFNNNT) NrNrFFNTNN)~rwrrenumrfrnos.pathrrr3r`r urllib.parsertypingrrrrrr dns._featuresr dns.exceptiondns.inet dns.messagedns.namedns.quic dns.rcodedns.rdataclass dns.rdatatype dns.serialdns.transactiondns.tsigdns.xfrrr _featureshave _have_httpxhttpcore._backends.syncr8rNetworkBackend_CoreNetworkBackend _backendssync SyncStreamr6r HTTPTransportrQrr` ImportErrorrr DNSExceptionrurryr{r~r TransferErrorr*rrrrrrr2rIntEnumrrZrrr4rfloatrrrrHeadersbytesr rrr,r1r7rNametsigKeyr@rFrKrSrWr]rcr5rJrtrkrrnrSyncQuicConnectionrrrrrAXFRrrdefault_algorithmrrrrr^rrrsu $    ::2 mm  ' ""11((--88O2&-2&h,,,&& .2Hs}}11HG#--))GCMM & & CMM & & %% $$800 ) "=A)%X( ./    $,,  & $ "!!'+#26"" + 3 3!D  {{D D e_D   D SM D  D D D c]D  D  D  }D  $) D ./D  D !D " [[#D N#((**%EO388++O3OeOO* $ "!#".  {{. .  . e_ .  . SM . . . .  $) . sm.  .  [[. b 1 1&#'    ##U* +   3: >"&"&#";?#&! %+/g4 g4#g4g4 g4  g4 d388==#((,,67 8 g4%g4g4g4g4 CKK'' (g4 g4Z $ #"! %X {{X Xe_X  X SM X  XXXXX 3-XX [[X| $ #"!""U  {{U U e_U   U SM U  U U U U smU smU U  3;;   $%U p * 1&#'$ $  ##U* +$$ 3: $@#'";?#&! , ,,,d388==#((,,67 8 , % ,  , 3;;   %&,^- $ "!B {{B Be_B  B SM B  BBB 3-B [[BJ.c],1$),<^^2 $ "!$(,0%)#h {{h he_h  h SM h  hhh 3== !h#..)hc]h $) h [[h\ $ "!8<#"%)Z  {{Z Z e_Z   Z SM Z  Z Z Z 445Z  $) Z smZ c]Z  [[Z z  dll  0:330: }}0: ;;  0: SM 0: e_ 0:  0: 0:l36--2D2D58^^5F5F#;?37 $ .1hh.H.HrG rG  s" #rG #--))3. /rG3>>,,c1 2 rG e_ rG  rGd388==#((,,67 8rGeCHHMM3./ 0rGrGuorG SMrGrG rGrG s*+rG  !rGp,0# $  H H33H CKK'' (H  H e_ H uo H SMHHH H},....s<a aa