/usr/lib/python3.9/site-packages/dns/__pycache__
NameSizeModeActions
asyncbackend.cpython-39.opt-1.pyc26160644editdlrm
asyncbackend.cpython-39.pyc26160644editdlrm
asyncquery.cpython-39.opt-1.pyc178050644editdlrm
asyncquery.cpython-39.pyc178170644editdlrm
asyncresolver.cpython-39.opt-1.pyc129580644editdlrm
asyncresolver.cpython-39.pyc130020644editdlrm
dnssec.cpython-39.opt-1.pyc321600644editdlrm
dnssec.cpython-39.pyc321880644editdlrm
dnssectypes.cpython-39.opt-1.pyc16160644editdlrm
dnssectypes.cpython-39.pyc16160644editdlrm
e164.cpython-39.opt-1.pyc34520644editdlrm
e164.cpython-39.pyc34520644editdlrm
edns.cpython-39.opt-1.pyc147200644editdlrm
edns.cpython-39.pyc147340644editdlrm
entropy.cpython-39.opt-1.pyc33480644editdlrm
entropy.cpython-39.pyc33480644editdlrm
enum.cpython-39.opt-1.pyc32490644editdlrm
enum.cpython-39.pyc32490644editdlrm
exception.cpython-39.opt-1.pyc55180644editdlrm
exception.cpython-39.pyc57140644editdlrm
flags.cpython-39.opt-1.pyc22080644editdlrm
flags.cpython-39.pyc22080644editdlrm
grange.cpython-39.opt-1.pyc10890644editdlrm
grange.cpython-39.pyc11330644editdlrm
immutable.cpython-39.opt-1.pyc24280644editdlrm
immutable.cpython-39.pyc24280644editdlrm
inet.cpython-39.opt-1.pyc46030644editdlrm
inet.cpython-39.pyc46030644editdlrm
ipv4.cpython-39.opt-1.pyc18440644editdlrm
ipv4.cpython-39.pyc18440644editdlrm
ipv6.cpython-39.opt-1.pyc39380644editdlrm
ipv6.cpython-39.pyc39380644editdlrm
message.cpython-39.opt-1.pyc506310644editdlrm
message.cpython-39.pyc506720644editdlrm
name.cpython-39.opt-1.pyc350740644editdlrm
name.cpython-39.pyc350890644editdlrm
namedict.cpython-39.opt-1.pyc29860644editdlrm
namedict.cpython-39.pyc29860644editdlrm
nameserver.cpython-39.opt-1.pyc89080644editdlrm
nameserver.cpython-39.pyc89080644editdlrm
node.cpython-39.opt-1.pyc116050644editdlrm
node.cpython-39.pyc116050644editdlrm
opcode.cpython-39.opt-1.pyc24750644editdlrm
opcode.cpython-39.pyc24750644editdlrm
query.cpython-39.opt-1.pyc402980644editdlrm
query.cpython-39.pyc403430644editdlrm
rcode.cpython-39.opt-1.pyc32530644editdlrm
rcode.cpython-39.pyc32530644editdlrm
rdata.cpython-39.opt-1.pyc236090644editdlrm
rdata.cpython-39.pyc236090644editdlrm
rdataclass.cpython-39.opt-1.pyc27920644editdlrm
rdataclass.cpython-39.pyc27920644editdlrm
rdataset.cpython-39.opt-1.pyc154370644editdlrm
rdataset.cpython-39.pyc154510644editdlrm
rdatatype.cpython-39.opt-1.pyc66730644editdlrm
rdatatype.cpython-39.pyc66730644editdlrm
renderer.cpython-39.opt-1.pyc98220644editdlrm
renderer.cpython-39.pyc98410644editdlrm
resolver.cpython-39.opt-1.pyc524720644editdlrm
resolver.cpython-39.pyc526250644editdlrm
reversename.cpython-39.opt-1.pyc30550644editdlrm
reversename.cpython-39.pyc30550644editdlrm
rrset.cpython-39.opt-1.pyc78850644editdlrm
rrset.cpython-39.pyc78990644editdlrm
serial.cpython-39.opt-1.pyc29330644editdlrm
serial.cpython-39.pyc29330644editdlrm
set.cpython-39.opt-1.pyc87990644editdlrm
set.cpython-39.pyc87990644editdlrm
tokenizer.cpython-39.opt-1.pyc172420644editdlrm
tokenizer.cpython-39.pyc172560644editdlrm
transaction.cpython-39.opt-1.pyc202610644editdlrm
transaction.cpython-39.pyc202610644editdlrm
tsig.cpython-39.opt-1.pyc103810644editdlrm
tsig.cpython-39.pyc103810644editdlrm
tsigkeyring.cpython-39.opt-1.pyc18350644editdlrm
tsigkeyring.cpython-39.pyc18350644editdlrm
ttl.cpython-39.opt-1.pyc16800644editdlrm
ttl.cpython-39.pyc16800644editdlrm
update.cpython-39.opt-1.pyc88860644editdlrm
update.cpython-39.pyc88860644editdlrm
version.cpython-39.opt-1.pyc5630644editdlrm
version.cpython-39.pyc5630644editdlrm
versioned.cpython-39.opt-1.pyc87230644editdlrm
versioned.cpython-39.pyc87750644editdlrm
win32util.cpython-39.opt-1.pyc56530644editdlrm
win32util.cpython-39.pyc56530644editdlrm
wire.cpython-39.opt-1.pyc33270644editdlrm
wire.cpython-39.pyc33550644editdlrm
xfr.cpython-39.opt-1.pyc77710644editdlrm
xfr.cpython-39.pyc77890644editdlrm
zone.cpython-39.opt-1.pyc452680644editdlrm
zone.cpython-39.pyc454120644editdlrm
zonefile.cpython-39.opt-1.pyc176630644editdlrm
zonefile.cpython-39.pyc176870644editdlrm
zonetypes.cpython-39.opt-1.pyc10230644editdlrm
zonetypes.cpython-39.pyc10230644editdlrm
_asyncbackend.cpython-39.opt-1.pyc42080644editdlrm
_asyncbackend.cpython-39.pyc42080644editdlrm
_asyncio_backend.cpython-39.opt-1.pyc89840644editdlrm
_asyncio_backend.cpython-39.pyc90020644editdlrm
_ddr.cpython-39.opt-1.pyc40710644editdlrm
_ddr.cpython-39.pyc40710644editdlrm
_features.cpython-39.opt-1.pyc23670644editdlrm
_features.cpython-39.pyc23670644editdlrm
_immutable_ctx.cpython-39.opt-1.pyc21590644editdlrm
_immutable_ctx.cpython-39.pyc21590644editdlrm
__init__.cpython-39.opt-1.pyc6670644editdlrm
__init__.cpython-39.pyc6670644editdlrm
Edit: /usr/lib/python3.9/site-packages/dns/__pycache__/resolver.cpython-39.pyc (52625B)
a àMÒePã@sÎUdZddlZddlZddlZddlZddlZddlZddlZddlm Z m Z m Z m Z m Z mZmZmZddlmZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl!Zddl"Zddl#Zddl$Zej%dk�rddl&ZGdd„dej'j(ƒZ)Gdd „d ej'j(ƒZ*ee e+e,e-ee.e+fe ej/j0fZ1e e1e e+d œd d „Z2Gd d„dej'j3ƒZ4e4Z3Gdd„dej'j(ƒZ5Gdd„dej'j(ƒZ6Gdd„dej'j(ƒZ7Gdd„dej'j(ƒZ8Gdd„dej'j(ƒZ9Gdd„dej'j(ƒZ:Gdd„dƒZ;Gdd„de<ƒZ=Gdd „d e=ƒZ>Gd!d"„d"ƒZ?Gd#d$„d$ƒZ@eejAjBejCjDejEjFfZGGd%d&„d&e@ƒZHGd'd(„d(ƒZIGd)d*„d*e@ƒZJGd+d,„d,ƒZKGd-d.„d.ƒZLGd/d0„d0eLƒZMdaNe eMeOd1<eMd2œd3d4„ZPdd2œd5d6„ZQejCjRejEjSd7dd8dddfeejAjBe+feejCjDe+feejEjFe+fe,e e+e,e-e eTe e,e;d9œ d:d;„ZUejCjRejEjSd7dd8ddfeejAjBe+feejCjDe+feejEjFe+fe,e e+e,e-e eTe;d<œ d=d>„ZVe+e e e;d?œd@dA„ZWejXfeejAjBe+fe-e e>dBœdCdD„ZYeejAjBe+fejAjBdEœdFdG„ZZdgeTddIœdJdK„Z[ejEjSd7ddfeejAjBe+fejEjFe,e eMe eTejAjBdLœdMdN„Z\dOejXdfeejAjBe+fe-e-e eMeMdPœdQdR„Z]ejCjRejEjSd7dd8ddddOejXdf eejAjBe+feejAjBe+feejCjDe+feejEjFe+fe,e e+e,e-e eTe e,e-e-e eMe;dSœdTdU„Z^ej_ej`gejaejbgiZcdadejeZfejgZhejiZjejkZlejmZnejoZpddejXdddfdVdW„ZqdhdXdY„ZrdidZd[„Zsd\d]„Ztd^d_„Zud`da„Zvdje eMddbœdcdd„Zwdd2œdedf„ZxdS)kúDNS stub resolver.éN)ÚAnyÚDictÚIteratorÚListÚOptionalÚSequenceÚTupleÚUnion)ÚurlparseÚwin32csteZdZdZddhZdZ‡fdd„Zddd„Zed œ‡fd d „ Z e d d „ƒZ dd„Z dd„Z dd„Zdd„Z‡ZS)ÚNXDOMAINz"The DNS query name does not exist.ÚqnamesÚ responsesNcstƒj|i|¤ŽdS©N©ÚsuperÚ__init__©ÚselfÚargsÚkwargs©Ú __class__©ú0/usr/lib/python3.9/site-packages/dns/resolver.pyr>szNXDOMAIN.__init__cCs\t|tttfƒstdƒ‚t|ƒdkr,tdƒ‚|dur:i}nt|tƒsLtdƒ‚t||d�}|S)Nz#qnames must be a list, tuple or setrz(qnames must contain at least one elementz(responses must be a dict(qname=response)©rr)Ú isinstanceÚlistÚtupleÚsetÚAttributeErrorÚlenÚdict)rrrrrrrÚ _check_kwargsAs   zNXDOMAIN._check_kwargs©ÚreturncsPd|jvrtƒ ¡S|jd}t|ƒdkr0d}nd}d tt|ƒ¡}d ||¡S)NrézNone of DNS query names existz!The DNS query name does not existz, z{}: {})rrÚ__str__r"ÚjoinÚmapÚstrÚformat)rrÚmsgrrrr(Ms    zNXDOMAIN.__str__c Cspd|jvrtdƒ‚|jdD]D}|jd|}z| ¡}||krJ|WSWqty^Yq0q|jddS)z%Return the unresolved canonical name.rzparametrized exception requiredrr)rÚ TypeErrorÚcanonical_nameÚ Exception)rÚqnameÚresponseÚcnamerrrr/Xs  zNXDOMAIN.canonical_namecCsxt|j dg¡ƒ}t|j di¡ƒ}|j di¡}|j dg¡D]*}||vrV| |¡||vr@||||<q@t||d�S)z3Augment by results from another NXDOMAIN exception.rrr)rrÚgetr#Úappendr )rZe_nxZqnames0Z responses0Z responses1Zqname1rrrÚ__add__is zNXDOMAIN.__add__cCs |jdS)zXAll of the names that were tried. Returns a list of ``dns.name.Name``. r©r©rrrrruszNXDOMAIN.qnamescCs |jdS)z˜A map from queried names to their NXDOMAIN responses. Returns a dict mapping a ``dns.name.Name`` to a ``dns.message.Message``. rr7r8rrrr|szNXDOMAIN.responsescCs|jd|S)zTThe response for query *qname*. Returns a ``dns.message.Message``. rr7)rr1rrrr2„szNXDOMAIN.response)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú supp_kwargsÚfmtrr$r+r(Úpropertyr/r6rrr2Ú __classcell__rrrrr 4s     r c@seZdZdZdS)ÚYXDOMAINz8The DNS query name is too long after DNAME substitution.N©r9r:r;r<rrrrrAŒsrA)Úerrorsr&cCs,g}|D]}| d |d|d¡¡q|S)z3Turn a resolution errors trace into a list of text.zServer {} answered {}ré)r5r,)rCZtextsÚerrrrrÚ_errors_to_text™srFcsHeZdZdZdZdedd…ZddhZ‡fdd„Z‡fd d „Z‡Z S) ÚLifetimeTimeoutz The resolution lifetime expired.z(%s after {timeout:.3f} seconds: {errors}NéÿÿÿÿÚtimeoutrCcstƒj|i|¤ŽdSrrrrrrrªszLifetimeTimeout.__init__c s&t|dƒ}tƒj|dd |¡d�S)NrCrIú; ©rIrC)rFrÚ _fmt_kwargsr)©rrZsrv_msgsrrrrL­s ÿzLifetimeTimeout._fmt_kwargs© r9r:r;r<r-r>r=rrLr@rrrrrG¡s  rGcs>eZdZdZdZdhZ‡fdd„Z‡fdd„Zdd „Z‡Z S) ÚNoAnswerzr=rrLr2r@rrrrrOºs   rOcsHeZdZdZdZdedd…ZddhZ‡fdd „Z‡fd d „Z‡Z S) Ú NoNameserverszôAll nameservers failed to answer the query. errors: list of servers and respective errors The type of errors is [(server IP address, any object convertible to string)]. Non-empty errors list will add explanatory message () z+All nameservers failed to answer the query.z%s {query}: {errors}NrHÚrequestrCcstƒj|i|¤ŽdSrrrrrrrÛszNoNameservers.__init__c s(t|dƒ}tƒj|djd |¡d�S)NrCrSrJ)rPrC)rFrrLrQr)rMrrrrLÞs ÿzNoNameservers._fmt_kwargsrNrrrrrRÌs  rRc@seZdZdZdS)Ú NotAbsolutezEAn absolute domain name is required but a relative name was provided.NrBrrrrrTåsrTc@seZdZdZdS)Ú NoRootSOAzBThere is no SOA RR at the DNS root name. This should never happen!NrBrrrrrUésrUc@seZdZdZdS)Ú NoMetaqueriesz DNS metaqueries are not allowed.NrBrrrrrVísrVc@seZdZdZdS)ÚNoResolverConfigurationzEResolver configuration could not be read or specified no nameservers.NrBrrrrrWñsrWc @sreZdZdZdejjejjej j ej j e ee eddœdd„Zdd„Zedœd d „Zd d „Zd d„Zdd„ZdS)ÚAnswera&DNS stub resolver answer. Instances of this class bundle up the result of a successful DNS resolution. For convenience, the answer object implements much of the sequence protocol, forwarding to its ``rrset`` attribute. E.g. ``for a in answer`` is equivalent to ``for a in answer.rrset``. ``answer[i]`` is equivalent to ``answer.rrset[i]``, and ``answer[i:j]`` is equivalent to ``answer.rrset[i:j]``. Note that CNAMEs or DNAMEs in the response may mean that answer RRset's name might not be the query name. N)r1ÚrdtypeÚrdclassr2Ú nameserverÚportr&cCsX||_||_||_||_||_||_| ¡|_|jj|_|jj |_ t   ¡|jj |_ dSr)r1rYrZr2r[r\Zresolve_chainingZchaining_resultr/ÚanswerÚrrsetÚtimeZ minimum_ttlÚ expiration)rr1rYrZr2r[r\rrrrs    zAnswer.__init__cCs\|dkr|jjS|dkr |jjS|dkr0|jjS|dkr@|jjS|dkrP|jjSt|ƒ‚dS)NÚnameÚttlÚcoversrZrY)r^rarbrcrZrYr!)rÚattrrrrÚ __getattr__szAnswer.__getattr__r%cCs|jrt|jƒpdS©Nr)r^r"r8rrrÚ__len__)szAnswer.__len__cCs|jrt|jƒpttƒƒSr)r^Úiterrr8rrrÚ__iter__,szAnswer.__iter__cCs|jdurt‚|j|Sr©r^Ú IndexError©rÚirrrÚ __getitem__/s zAnswer.__getitem__cCs|jdurt‚|j|=dSrrjrlrrrÚ __delitem__4s zAnswer.__delitem__)NN)r9r:r;r<ÚdnsraÚNameÚ rdatatypeÚ RdataTypeÚ rdataclassÚ RdataClassÚmessageÚ QueryMessagerr+ÚintrrergrirnrorrrrrXõs"ùø rXc@seZdZdZdS)ÚAnswersz5A dict of DNS stub resolver answers, indexed by type.NrBrrrrry:sryc@s€eZdZdZedeeeeeddœdd„ƒZe j fe e e ee fdœdd „Ze j fe e edœd d „Zejjd œd d„ZdS)Ú HostAnswerszTA dict of DNS stub resolver answers to a host name lookup, indexed by type. NT)Úv6Úv4Ú add_emptyr&cCsFtƒ}|dur$|s|jr$||tjj<|durB|s6|jrB||tjj<|Sr)rzr^rprrÚAAAAÚA)Úclsr{r|r}ÚanswersrrrÚmakeCs   zHostAnswers.make)Úfamilyr&ccs’|tjkr2| tj¡EdH| tj¡EdHdS|tjkrL| tjj¡}n(|tjkrf| tjj ¡}nt d|›�ƒ‚|rŽ|D]}|j |fVq|dS)Núunknown address family ) ÚsocketÚ AF_UNSPECÚaddresses_and_familiesÚAF_INET6ÚAF_INETr4rprrr~rÚNotImplementedErrorÚaddress)rrƒr]Zrdatarrrr‡Ss   z"HostAnswers.addresses_and_familiescCsdd„| |¡DƒS)Ncss|]}|dVqdS)rNr)Ú.0ZpairrrrÚ góz(HostAnswers.addresses..)r‡)rrƒrrrÚ addressesfszHostAnswers.addressesr%cCs | tjj| tjj¡¡}|jSr)r4rprrr~rr/)rr]rrrr/jszHostAnswers.canonical_name)NNT)r9r:r;r<Ú classmethodrrXÚboolr‚r…r†rxrr r+r‡r�rprarqr/rrrrrz>s$üûÿþ rzc@s@eZdZdZd eeddœdd„Zddœdd „Zddœd d „ZdS) ÚCacheStatisticszCache StatisticsrN)ÚhitsÚmissesr&cCs||_||_dSr©r“r”)rr“r”rrrrrszCacheStatistics.__init__r%cCsd|_d|_dSrfr•r8rrrÚresetvszCacheStatistics.resetcCst|j|jƒSr)r’r“r”r8rrrÚclonezszCacheStatistics.clone)rr)r9r:r;r<rxrr–r—rrrrr’osr’c@sReZdZddœdd„Zddœdd„Zedœdd„Zedœd d „Zedœd d „Z dS) Ú CacheBaseNr%cCst ¡|_tƒ|_dSr)Ú threadingÚLockÚlockr’Ú statisticsr8rrrrs zCacheBase.__init__cCs4|j�|j ¡Wdƒn1s&0YdS)zReset all statistics to zero.N)r›rœr–r8rrrÚreset_statisticsƒszCacheBase.reset_statisticscCs2|j�|jjWdƒS1s$0YdS)z How many hits has the cache had?N)r›rœr“r8rrrr“ˆszCacheBase.hitscCs2|j�|jjWdƒS1s$0YdS)z"How many misses has the cache had?N)r›rœr”r8rrrr”�szCacheBase.missescCs4|j�|j ¡WdƒS1s&0YdS)zàReturn a consistent snapshot of all the statistics. If running with multiple threads, it's better to take a snapshot than to call statistics methods such as hits() and misses() individually. N)r›rœr—r8rrrÚget_statistics_snapshot’sz!CacheBase.get_statistics_snapshot) r9r:r;rr�rxr“r”r’ržrrrrr˜~s r˜csteZdZdZdeddœ‡fdd„ Zddœdd „Zeee d œd d „Z ee dd œdd„Z deedd œdd„Z ‡Z S)ÚCachez$Simple thread-safe DNS answer cache.çÀr@N)Úcleaning_intervalr&cs*tƒ ¡i|_||_t ¡|j|_dS)zf*cleaning_interval*, a ``float`` is the number of seconds between periodic cleanings. N)rrÚdatar¡r_Ú next_cleaning)rr¡rrrr£s zCache.__init__r%cCsht ¡}|j|krdg}|j ¡D]\}}|j|kr | |¡q |D] }|j|=qBt ¡}||j|_dS)z&Clean the cache if it's time to do so.N)r_r£r¢Úitemsr`r5r¡)rÚnowZkeys_to_deleteÚkÚvrrrÚ _maybe_clean­s    zCache._maybe_clean©Úkeyr&cCsˆ|j�n| ¡|j |¡}|dus2|jt ¡krR|jjd7_WdƒdS|jjd7_|WdƒS1sz0YdS©aKGet the answer associated with *key*. Returns None if no answer is cached for the key. *key*, a ``(dns.name.Name, dns.rdatatype.RdataType, dns.rdataclass.RdataClass)`` tuple whose values are the query name, rdtype, and rdclass respectively. Returns a ``dns.resolver.Answer`` or ``None``. Nr') r›r¨r¢r4r`r_rœr”r“)rrªr§rrrr4»s  z Cache.get©rªÚvaluer&cCs<|j�"| ¡||j|<Wdƒn1s.0YdS©aAssociate key and value in the cache. *key*, a ``(dns.name.Name, dns.rdatatype.RdataType, dns.rdataclass.RdataClass)`` tuple whose values are the query name, rdtype, and rdclass respectively. *value*, a ``dns.resolver.Answer``, the answer. N)r›r¨r¢©rrªr­rrrÚputÏs z Cache.putcCs\|j�B|dur$||jvr:|j|=ni|_t ¡|j|_Wdƒn1sN0YdS©a2Flush the cache. If *key* is not ``None``, only that item is flushed. Otherwise the entire cache is flushed. *key*, a ``(dns.name.Name, dns.rdatatype.RdataType, dns.rdataclass.RdataClass)`` tuple whose values are the query name, rdtype, and rdclass respectively. N)r›r¢r_r¡r£)rrªrrrÚflushÜs   z Cache.flush)r )N)r9r:r;r<Úfloatrr¨ÚCacheKeyrrXr4r°r²r@rrrrrŸ s   rŸc@s6eZdZdZdd„Zdddœdd„Zddœd d „ZdS) Ú LRUCacheNodezLRUCache node.cCs"||_||_d|_||_||_dSrf)rªr­r“ÚprevÚnextr¯rrrròs zLRUCacheNode.__init__N)Únoder&cCs ||_|j|_||j_||_dSr©r¶r·)rr¸rrrÚ link_afterùszLRUCacheNode.link_afterr%cCs|j|j_|j|j_dSrr¹r8rrrÚunlinkÿs zLRUCacheNode.unlink)r9r:r;r<rrºr»rrrrrµïsrµcs†eZdZdZdeddœ‡fdd„ Zeddœdd„Zeee d œd d „Z eed œd d „Z ee ddœdd„Z deedd œdd„Z ‡ZS)ÚLRUCachea`Thread-safe, bounded, least-recently-used DNS answer cache. This cache is better than the simple cache (above) if you're running a web crawler or other process that does a lot of resolutions. The LRUCache has a maximum number of nodes, and when it is full, the least-recently used node is removed to make space for a new one. é †N)Úmax_sizer&cs>tƒ ¡i|_| |¡tddƒ|_|j|j_|j|j_dS)zl*max_size*, an ``int``, is the maximum number of nodes to cache; it must be greater than 0. N)rrr¢Ú set_max_sizerµÚsentinelr¶r·©rr¾rrrrs     zLRUCache.__init__cCs|dkr d}||_dS)Nr')r¾rÁrrrr¿szLRUCache.set_max_sizer©cCsÐ|j�¶|j |¡}|dur<|jjd7_WdƒdS| ¡|jjt ¡kr~|j|j =|jjd7_WdƒdS|  |j ¡|jj d7_ |j d7_ |jWdƒS1sÂ0YdSr«) r›r¢r4rœr”r»r­r`r_rªrºrÀr“©rrªr¸rrrr4s    z LRUCache.getcCsr|j�X|j |¡}|dus,|jjt ¡krz t|ƒ}WqHty:td|›�ƒ‚YqH0n t |¡}|��–}|D�]~}t|ƒdksT|ddksT|ddkr€qT| ¡}t|ƒdkr–qT|ddkr²|  |d¡qT|ddkrØt j   |d¡|_ g|_qT|dd k�rg|_|dd …D]}|j  t j   |¡¡qøqT|dd krT|dd …D]¦}|d k�rBd |_nŽ|dk�rV| ¡nzd|v�r”zt| d¡dƒ|_Wnttf�y�Yn0n|dus|durd}n |dur"d}||_||_||_||_dS)aŒ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. *options*, a list of ``dns.edns.Option`` objects or ``None``, the EDNS options. NFrHTr)rârãrärå)rrârãrärØrrrráoszBaseResolver.use_edns)rær&cCs ||_dS)zkOverrides the default flags with your own. *flags*, an ``int``, the message flags to use. N)ræ)rrærrrÚ set_flags�szBaseResolver.set_flags)rÑréÚ default_portr&c Cs¼g}t|tƒr¦|D]�}t|tjjƒr*|}nntj |¡rR| ||¡}tj ||¡}nFzt |ƒj dkrft ‚Wn"t yŠt d|›d�ƒ‚Yn0tj |¡}| |¡qnt d t|ƒ¡ƒ‚|S)NÚhttpsz nameserver z\ is not a dns.nameserver.Nameserver instance or text form, IP address, nor a valid https URLz.nameservers must be a list or tuple (not a {}))rrrpr[rúÚinetÚ is_addressr4ÚDo53Nameserverr ÚschemerŠr0rZ DoHNameserverr5r,Útype)r€rÑrér!Zenriched_nameserversr[Zenriched_nameserverr\rrrrç˜s2   ÿ  ÿ  ÿÿz BaseResolver._enrich_nameserverscCs|jSr)rèr8rrrrѾszBaseResolver.nameservers)rÑr&cCs| ||j|j¡||_dS)a  *nameservers*, a ``list`` of nameservers, where a nameserver is either a string interpretable as a nameserver, or a ``dns.nameserver.Nameserver`` instance. Raises ``ValueError`` if *nameservers* is not a list of nameservers. N)rçrér\rè)rrÑrrrrÑÄs )rT)NN))r9r:r;r<rprarqÚ__annotations__rr+rxrr‘r³rrr râZOptionrr[rúrr–rrÚ ErrorTuplerrÍr r rÞrvZDEFAULT_EDNS_PAYLOADrár r�rçr?rÑÚsetterrrrrrÆ�s’     ÿþ Gü û   þ ,üû ûú !  û%þþrÆc @sHeZdZdZejjejjddddddfe ej j e fe ejj e fe ejje feee eeeeeeedœ dd„Zejjejjdddddfe ej j e fe ejj e fe ejje feee eeeeed œ d d „Ze eeed œd d„Zejfe ej j e feeedœdd„Ze ej j e fej j dœdd„Zdeddœdd„ZdS)ÚResolverrFNTr© r1rYrZrÈÚsourcerÉÚ source_portrþrÊr&c  Csòt||||||| ƒ} t ¡} |  ¡\} } | dur4| S| dus@J‚d}|s|  ¡\}}}|rdt |¡| | || j¡}z|j| ||||d�}Wn@tyÌ}z(|   d|¡\}}WYd}~qDWYd}~n d}~00|   |d¡\} }| durD| SqDqdS)a”Query nameservers to find the answer to the question. The *qname*, *rdtype*, and *rdclass* parameters may be objects of the appropriate type, or strings that can be converted into objects of the appropriate type. *qname*, a ``dns.name.Name`` or ``str``, the query name. *rdtype*, an ``int`` or ``str``, the query type. *rdclass*, an ``int`` or ``str``, the query class. *tcp*, a ``bool``. If ``True``, use TCP to make the query. *source*, a ``str`` or ``None``. If not ``None``, bind to this IP address when making queries. *raise_on_no_answer*, a ``bool``. If ``True``, raise ``dns.resolver.NoAnswer`` if there's no answer to the question. *source_port*, an ``int``, the port from which to send the message. *lifetime*, a ``float``, how many seconds a query should run before timing out. *search*, a ``bool`` or ``None``, determines whether the search list configured in the system's resolver configuration are used for relative names, and whether the resolver's domain may be added to relative names. The default is ``None``, which causes the value of the resolver's ``use_search_by_default`` attribute to be used. Raises ``dns.resolver.LifetimeTimeout`` if no answers could be found in the specified lifetime. Raises ``dns.resolver.NXDOMAIN`` if the query name does not exist. Raises ``dns.resolver.YXDOMAIN`` if the query name is too long after DNAME substitution. Raises ``dns.resolver.NoAnswer`` if *raise_on_no_answer* is ``True`` and the query name exists but has no RRset of the desired type and class. Raises ``dns.resolver.NoNameservers`` if no non-broken nameservers are available to answer the question. Returns a ``dns.resolver.Answer`` instance. NF)rIr-r.r¾) rÅr_rìrïÚsleeprrCrPr0rù)rr1rYrZrÈr-rÉr.rþrÊZ resolutionrrSr]Zdoner[rÕrIr2rðÚ_rrrÚresolve×s8?ÿ   û "zResolver.resolve© r1rYrZrÈr-rÉr.rþr&c Cs*tjdtdd�| ||||||||d¡ S)a$Query nameservers to find the answer to the question. This method calls resolve() with ``search=True``, and is provided for backwards compatibility with prior versions of dnspython. See the documentation for the resolve() method for further details. z2please use dns.resolver.Resolver.resolve() insteadrí©Ú stacklevelT©ÚwarningsÚwarnÚDeprecationWarningr1) rr1rYrZrÈr-rÉr.rþrrrrP=s ý÷zResolver.query©Úipaddrrrr&cOsFi}| |¡tjj|d<tjj|d<|jtj |¡g|¢Ri|¤ŽS)a¨Use a resolver to run a reverse query for PTR records. This utilizes the resolve() method to perform a PTR lookup on the specified IP address. *ipaddr*, a ``str``, the IPv4 or IPv6 address you want to get the PTR record for. All other arguments that can be passed to the resolve() function except for rdtype and rdclass are also supported by this function. rYrZ) ÚupdaterprrÚPTRrtrõr1Ú reversenameÚ from_address)rr:rrÚmodified_kwargsrrrÚresolve_address`s    ÿÿÿzResolver.resolve_address©rarƒrr&c Ks4i}| |¡| dd¡tjj|d<|tjkrT|j|tjj fi|¤Ž}t j |d�S|tj kr‚|j|tjj fi|¤Ž}t j |d�S|tjkrštd|›�ƒ‚| dd¡}| d d¡}t ¡} |j|tjj fd | | |¡d œ|¤Ž}|j}|j|tjj fd | | |¡d œ|¤Ž}t j ||| d �} | �s0t|jd �‚| S)aUse a resolver to query for address records. This utilizes the resolve() method to perform A and/or AAAA lookups on the specified name. *qname*, a ``dns.name.Name`` or ``str``, the name to resolve. *family*, an ``int``, the address family. If socket.AF_UNSPEC (the default), both A and AAAA records will be retrieved. All other arguments that can be passed to the resolve() function except for rdtype and rdclass are also supported by this function. rYNrZ)r|)r{r„rÉTrþF)rÉrþ)r{r|r}rÖ)r;rÙrprtrõr…r‰r1rrrrzr‚rˆr~r†rŠr_rr1rOr2) rrarƒrr?r|r{rÉrþrr�rrrÚ resolve_namexsL          þ üû þ üû zResolver.resolve_name©rar&c CsLz|j|dd�}|j}Wn.tjjyF}z|j}WYd}~n d}~00|S)a»Determine the canonical name of *name*. The canonical name is the name the resolver uses for queries after all CNAME and DNAME renamings have been applied. *name*, a ``dns.name.Name`` or ``str``, the query name. This method can raise any exception that ``resolve()`` can raise, other than ``dns.resolver.NoAnswer`` and ``dns.resolver.NXDOMAIN``. Returns a ``dns.name.Name``. F)rÉN)r1r/rprÇr )rrar]r/rørrrr/»s  zResolver.canonical_namer©rþr&cCshzPt ¡|}|jtjjd|d�}tj |¡}tj ||¡}t|ƒdkrN||_ Wnt ybYn0dS)aÃTry to update the resolver's nameservers using Discovery of Designated Resolvers (DDR). If successful, the resolver will subsequently use DNS-over-HTTPS or DNS-over-TLS for future queries. *lifetime*, a float, is the maximum time to spend attempting DDR. The default is 5 seconds. If the SVCB query is successful and results in a non-empty list of nameservers, then the resolver's nameservers are set to the returned servers in priority order. The current implementation does not use any address hints from the SVCB record, nor does it resolve addresses for the SCVB target name, rather it assumes that the bootstrap nameserver will always be one of the addresses and uses it. A future revision to the code may offer fuller support. The code verifies that the bootstrap nameserver is in the Subject Alternative Name field of the TLS certficate. ZSVCB©rþrN) r_r1rpZ_ddrZ_local_resolver_namerPZ _remainingZ_get_nameservers_syncr"rÑr0)rrþr`r]rIrÑrrrÚtry_ddrÒs  ÿ    zResolver.try_ddr)r)r9r:r;r<rprrrrtrõr rarqr+rsrur‘rrxr³rXr1rPrr@r…r†rzrBr/rFrrrrr+Ôsböõ i÷ö #ýû C r+Údefault_resolverr%cCstdurtƒtdusJ‚tS)z7Get the default resolver, initializing it if necessary.N)rGÚreset_default_resolverrrrrÚget_default_resolverös rIcCs tƒadS)z—Re-initialize default resolver. Note that the resolver configuration (i.e. /etc/resolv.conf on UNIX systems) will be re-read immediately. N)r+rGrrrrrHþsrHFTr,c Cstƒ |||||||||¡ S)zòQuery nameservers to find the answer to the question. This is a convenience function that uses the default resolver object to make the query. See ``dns.resolver.Resolver.resolve`` for more information on the parameters. )rIr1) r1rYrZrÈr-rÉr.rþrÊrrrr1 s÷r1r2c Cs(tjdtdd�t||||||||dƒ S)aQuery nameservers to find the answer to the question. This method calls resolve() with ``search=True``, and is provided for backwards compatibility with prior versions of dnspython. See the documentation for the resolve() method for further details. z)please use dns.resolver.resolve() insteadrír3Tr5)r1rYrZrÈr-rÉr.rþrrrrP*sÿ÷rPr9cOstƒj|g|¢Ri|¤ŽS)zšUse a resolver to run a reverse query for PTR records. See ``dns.resolver.Resolver.resolve_address`` for more information on the parameters. )rIr@)r:rrrrrr@Ksr@rAcKstƒj||fi|¤ŽS)z�Use a resolver to query for address records. See ``dns.resolver.Resolver.resolve_name`` for more information on the parameters. )rIrB)rarƒrrrrrBUs rBrCcCs tƒ |¡S)z¢Determine the canonical name of *name*. See ``dns.resolver.Resolver.canonical_name`` for more information on the parameters and possible exceptions. )rIr/©rarrrr/asr/rrDcCs tƒ |¡S)aTry to update the default resolver's nameservers using Discovery of Designated Resolvers (DDR). If successful, the resolver will subsequently use DNS-over-HTTPS or DNS-over-TLS for future queries. See :py:func:`dns.resolver.Resolver.try_ddr` for more information. )rIrFrErrrrFksrF)rarZrÈrÇrþr&c Csªt|tƒrtj |tjj¡}|dur*tƒ}| ¡s:t|ƒ‚t   ¡}|durT||}nd}zb|dur||t   ¡}|dkr€d}nd}|j |tj j |||d�}|j dus¦J‚|j j|kr¸|WSWn¾tjjtjjf�yx} z˜t| tjjƒrö|  ¡ |¡} n|  ¡} | �rd| jD]X} | jtj j k�r | j|k�r | j |¡\} } } | tjjk�r | jWYd} ~ S�q WYd} ~ n d} ~ 00z | ¡}WqXtjj�y¢t‚YqX0qXdS)a¤Find the name of the zone which contains the specified name. *name*, an absolute ``dns.name.Name`` or ``str``, the query name. *rdclass*, an ``int``, the query class. *tcp*, a ``bool``. If ``True``, use TCP to make the query. *resolver*, a ``dns.resolver.Resolver`` or ``None``, the resolver to use. If ``None``, the default, then the default resolver is used. *lifetime*, a ``float``, the total time to allow for the queries needed to determine the zone. If ``None``, the default, then only the individual query limits of the resolver apply. Raises ``dns.resolver.NoRootSOA`` if there is no SOA RR at the DNS root. (This is only likely to happen if you're using non-default root servers in your network and they are misconfigured.) Raises ``dns.resolver.LifetimeTimeout`` if the answer could not be found in the allotted lifetime. Returns a ``dns.name.Name``. NrrE)rr+rprarÌr rIrrTr_r1rrZSOAr^rÇr rOrr4r2Z authorityrYrZZ fullcompareZNAMERELN_SUPERDOMAINÚparentZNoParentrU)rarZrÈrÇrþrr`Z rlifetimer]rør2ZrrsÚnrr0rrrÚ zone_for_nameusH   ÿ   0 rMr)Úwherer\rƒrÇr&cCs€|durtƒ}g}t|tƒr>tj |¡r>| tj ||¡¡n*|  ||¡  ¡D]}| tj ||¡¡qNtj j dd�}||_ |S)aMake a stub resolver using the specified destination as the full resolver. *where*, a ``dns.name.Name`` or ``str`` the domain name or IP address of the full resolver. *port*, an ``int``, the port to use. If not specified, the default is 53. *family*, an ``int``, the address family to use. This parameter is used if *where* is not an address. The default is ``socket.AF_UNSPEC`` in which case the first address returned by ``resolve_name()`` will be used, otherwise the first address of the specified family will be used. *resolver*, a ``dns.resolver.Resolver`` or ``None``, the resolver to use for resolution of hostnames. If not specified, the default resolver will be used. Returns a ``dns.resolver.Resolver`` or raises an exception. NF)r)rIrr+rpr#r$r5r[r%rBr�rÇr+rÑ)rNr\rƒrÇrÑr‹ÚresrrrÚmake_resolver_atÊsrP)rNr1rYrZrÈr-rÉr.rþrÊr\rƒrÇr&c Cs$t|| | | ƒ ||||||||| ¡ S)a}Query nameservers to find the answer to the question. This is a convenience function that calls ``dns.resolver.make_resolver_at()`` to make a resolver, and then uses it to resolve the query. See ``dns.resolver.Resolver.resolve`` for more information on the resolution parameters, and ``dns.resolver.make_resolver_at`` for information about the resolver parameters *where*, *port*, *family*, and *resolver*. If making more than one query, it is more efficient to call ``dns.resolver.make_resolver_at()`` and then use that resolver for the queries instead of calling ``resolve_at()`` multiple times. )rPr1) rNr1rYrZrÈr-rÉr.rþrÊr\rƒrÇrrrÚ resolve_atîs÷rQc CsT|tj@dkr t||||||ƒS|tjtjB@dkrBt tjd¡‚|dur`|dur`t tjd¡‚g}d}|dur‚t||||||ƒSz tj   |¡t||||||ƒWSt y´Yn0z&t   ||¡}| ¡}| ¡ d¡}WnFtjj�yt tjd¡‚Yn"t �y"t tjd¡‚Yn0d} z|du�r:d} nt|ƒ} WnHt �yŒ|tj@dk�rˆzt |¡} Wnt �y†Yn0Yn0| du�r¦t tjd¡‚g} |dk�rÂtjtjg} n|g} |tj@dk�rÞ|} nd} |D]L\} }| D]<}t|D],}tj  | | f|¡}|  |||| |f¡�qþ�qò�qæt| ƒdk�rPt tjd¡‚| S)Nrz*Non-recoverable failure in name resolutionúName or service not knownTz$Temporary failure in name resolutionÚ)r…ZAI_NUMERICHOSTÚ_original_getaddrinfoZ AI_ADDRCONFIGZ AI_V4MAPPEDÚgaierrorZEAI_FAILÚ EAI_NONAMErpr#Zaf_for_addressr0Ú _resolverrBr‡r/r÷rÇr Z EAI_AGAINrxZAI_NUMERICSERVZ getservbynameÚ SOCK_DGRAMÚ SOCK_STREAMÚ AI_CANONNAMEÚ_protocols_for_socktypeZlow_level_address_tupler5r")ÚhostÚservicerƒZsocktypeÚprotoræZaddrsr/r�r\ÚtuplesZ socktypesr3ÚaddrÚafZ addr_tuplerrrÚ _getaddrinfo*sj ÿ           rbc Csf|d}|d}t|ƒdkr,|d}tj}n d}tj}t|||tjtjdƒ}t|ƒdkrbt d¡‚|ddd}|tj@r‚d}nd}t j   |¡} |tj @dk�rz"t  | d¡} | jdj d ¡} WnVt jjt jjf�y|tj@røt tjd ¡‚|} |du�r| d t|ƒ7} Yn0n|} |du�r<| d t|ƒ7} |tj@�rRt|ƒ} n t ||¡} | | fS) Nrr'érDz'sockaddr resolved to multiple addressesZudprÈr<TrRú%)r"r…rˆr‰rbrYÚSOL_TCPÚerrorZNI_DGRAMrpr=r>ZNI_NUMERICHOSTrWr1r^Útargetr÷rÇr rOÚ NI_NAMEREQDrUrVr+ZNI_NUMERICSERVZ getservbyport) Úsockaddrrær\r\Zscoperƒr_r`Zpnamer1r]Úhostnamer]rrrÚ _getnameinfo~s@            rkcCs:|durt ¡}zt|ƒ\}}}Wnty4Yn0|Sr)r…r Ú_gethostbyaddrr0)rar0rrrÚ_getfqdn¥s rmcCst|ƒddS)Nrír)Ú_gethostbyname_exrJrrrÚ_gethostbyname±srocCsTg}g}t|dtjtjtjtjƒ}|dd}|D]}| |dd¡q2|||fS)NrrDrc)rbr…r‰rYrerZr5)raÚaliasesr�r_Ú canonicalÚitemrrrrnµsÿ rnc Csz"tj |¡|dddf}tj}WnRtytztj |¡Wn ty`t tjd¡‚Yn0|df}tj }Yn0t |tj ƒ\}}g}g}t |d|tj tjtjƒ}|dd}tj ||¡} |D]0} | dd} tj || ¡} | | krÄ| | ¡qÄ|||fS)NéPrrRrDrc)rpZipv6Z inet_atonr…rˆr0Zipv4rUrVr‰rkrhrbrYrerZr#Z inet_ptonr5) Ziprirƒrar0rpr�r_rqZbin_iprrr`Zbin_addrrrrrlÂs2      ÿ   rl)rÇr&cCs:|durtƒ}|att_tt_tt_t t_ t t_ t t_dS)aåOverride the system resolver routines in the socket module with versions which use dnspython's resolver. This can be useful in testing situations where you want to control the resolution behavior of python code without having to change the system's resolver settings (e.g. /etc/resolv.conf). The resolver to use may be specified; if it's not, the default resolver will be used. resolver, a ``dns.resolver.Resolver`` or ``None``, the resolver to use. N)rIrWrbr…Ú getaddrinforkÚ getnameinformÚgetfqdnroÚ gethostbynamernÚgethostbyname_exrlÚ gethostbyaddr)rÇrrrÚoverride_system_resolverâsrzcCs,datt_tt_tt_tt_ t t_ t t_ dS)z5Undo the effects of prior override_system_resolver().N)rWrTr…rtÚ_original_getnameinforuÚ_original_getfqdnrvÚ_original_gethostbynamerwÚ_original_gethostbyname_exrxÚ_original_gethostbyaddrryrrrrÚrestore_system_resolverüsr€)r)r)N)N)yr<rrër…rr™r_r6Útypingrrrrrrr r Ú urllib.parser Zdns._ddrrpZdns.ednsZ dns.exceptionZ dns.flagsZdns.inetZdns.ipv4Zdns.ipv6Z dns.messageZdns.nameZdns.nameserverZ dns.queryZ dns.rcodeZdns.rdataclassZ dns.rdatatypeZdns.rdtypes.svcbbaseZdns.reversenameZdns.tsigrZ dns.win32utilrñZ DNSExceptionr rAr+r‘rxr0rvrûr)rFZTimeoutrGrOrRrTrUrVrWrXr#ryrzr’r˜rarqrrrsrtrur´rŸrµr¼rÅrÆr+rGr(rIrHrrõr³r1rPr@r†rBr/rFrMrPrQrXZSOL_UDPrYrer[rWrtrTrur{rvr|rwr}rxr~ryrrbrkrmrornrlrzr€rrrrÚsl(  X  üÿ E1OoU! ÷ö #ø÷ ! ÿþ  ûú Wüû 'óò /  þÿ T '