
    ,hE                        d Z ddlZddlZddlmZmZmZmZmZ ddl	Z
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlmZmZmZmZ e
j.                  j0                  Ze
j.                  j4                  Z G d de
j8                  j:                        ZdadefdZ d(d	Z!e
jD                  jF                  e
jH                  jJ                  d
ddddddf	dee
jL                  jN                  e(f   dee
jD                  jR                  e(f   dee
jH                  jT                  e(f   de+dee(   de+de,dee-   dee+   dee
j\                  j^                     de
j8                  j`                  fdZ1de(dedede
j8                  j`                  fdZ2ejf                  fdee
jL                  jN                  e(f   de,dede
j8                  jh                  fdZ5dee
jL                  jN                  e(f   de
jL                  jN                  fdZ6d)de-ddfd Z7e
jH                  jJ                  d
ddfdee
jL                  jN                  e(f   de
jH                  jT                  de+d!ee   dee
j\                  j^                     de
jL                  jN                  fd"Z8d#ejf                  dfd$ee
jL                  jN                  e(f   d%e,de,d!ee   def
d&Z9e
jD                  jF                  e
jH                  jJ                  d
ddddddd#ejf                  dfd$ee
jL                  jN                  e(f   dee
jL                  jN                  e(f   dee
jD                  jR                  e(f   dee
jH                  jT                  e(f   de+dee(   de+de,dee-   dee+   dee
j\                  j^                     d%e,de,d!ee   de
j8                  j`                  fd'Z:y)*Asynchronous DNS stub resolver.    N)AnyDictListOptionalUnion)NXDOMAINNoAnswer	NoRootSOANotAbsolutec                      e Zd ZdZej
                  j                  ej                  j                  dddddddf	de	ej                  j                  ef   de	ej
                  j                  ef   de	ej                  j                  ef   d	ed
ee   dededee   dee   deej&                  j(                     dej*                  j,                  fdZdedededej*                  j,                  fdZej6                  fde	ej                  j                  ef   dededej*                  j8                  fdZde	ej                  j                  ef   dej                  j                  fdZddeddfdZy)Resolverr   FNTr   qnamerdtyperdclasstcpsourceraise_on_no_answersource_portlifetimesearchbackendreturnc           	      l  K   t         j                  j                  | ||||||	      }|
st         j                  j	                         }
t        j
                         }	 |j                         \  }}||S |J d}|s|j                         \  }}}|r|
j                  |       d{    | j                  |||j                        }	 |j                  ||||||
       d{   }|j                  |d      \  }}||S |s7 ^7 ## t        $ r}|j                  d|      \  }}Y d}~d}~ww xY ww)a  Query nameservers asynchronously to find the answer to the question.

        *backend*, a ``dns.asyncbackend.Backend``, or ``None``.  If ``None``,
        the default, then dnspython will use the default backend.

        See :py:func:`dns.resolver.Resolver.resolve()` for the
        documentation of the other parameters, exceptions, and return
        type of this method.
        NF)timeoutr   r   max_sizer   )dnsresolver_Resolutionasyncbackendget_default_backendtimenext_requestnext_nameserversleep_compute_timeouterrorsasync_query	Exceptionquery_result)selfr   r   r   r   r   r   r   r   r   r   
resolutionstartrequestanswerdone
nameserverbackoffr   responseex_s                         S/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/dns/asyncresolver.pyresolvezResolver.resolve-   s]    . \\--%#/A6

 &&::<G		 * 7 7 9Wf
 !&&D-7-G-G-I*S'!--000//xARARS%/%;%; '%$/!$ ' &< &  H ",!8!84!H
 %!M/   1  !  * 7 7b AIQsT   B$D4&D'!D4	D	 #D$D	 (D4D4D	 		D1D,'D4,D11D4ipaddrargskwargsc                   K   i }|j                  |       t        j                  j                  |d<   t        j                  j
                  |d<    | j                  t        j                  j                  |      g|i | d{   S 7 w)a  Use an asynchronous 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.

        r   r   N)	updater   	rdatatypePTR
rdataclassINr7   reversenamefrom_address)r+   r8   r9   r:   modified_kwargss        r6   resolve_addresszResolver.resolve_addressn   s     ( +-v&$'MM$5$5!%(^^%6%6	"!T\\OO((0
37
;J
 
 	
 
s   BBBBnamefamilyc                   K   i }|j                  |       |j                  dd       t        j                  j                  |d<   |t
        j                  k(  r^ | j                  |t        j                  j                  fi | d{   }t        j                  j                  j                  |      S |t
        j                  k(  r^ | j                  |t        j                  j                  fi | d{   }t        j                  j                  j                  |      S |t
        j                  k7  rt!        d|       |j                  dd      }|j                  d	d      }t#        j"                         }	 | j                  |t        j                  j                  fd
| j%                  |	|      d| d{   }|j&                  } | j                  |t        j                  j                  fd
| j%                  |	|      d| d{   }t        j                  j                  j                  |||       }
|
st)        |j*                        |
S 7 7 l7 7 Sw)a  Use an asynchronous 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.
        r   Nr   )v4)v6zunknown address family r   Tr   F)r   r   )rI   rH   	add_empty)r3   )r<   popr   r?   r@   socketAF_INETr7   r=   Ar   HostAnswersmakeAF_INET6AAAA	AF_UNSPECNotImplementedErrorr"   r&   r   r
   r3   )r+   rE   rF   r:   rC   rH   rI   r   r   r-   answerss              r6   resolve_namezResolver.resolve_name   s%    . +-v&Hd+%(^^%6%6	"V^^##t||D#--//M_MMB<<++00B077v&#t||D#--*<*<PPPB<<++00B077v'''%(?x&HII,001EtL"&&z48		4<<MM
  %**5(;	

 
 
 xx4<<MMOO
  %**5(;	

 
 
 ,,**//b(:$: 0 
 BKK00I N Q

sL   BI+I!A0I+8I$9C	I+I'AI+I)AI+$I+'I+)I+c                    K   	 | j                  |d       d{   }|j                  }|S 7 # t        j                  j                  $ r}|j                  }Y d}~|S d}~ww xY ww)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)r7   canonical_namer   r   r	   )r+   rE   r/   rX   es        r6   rX   zResolver.canonical_name   sc     	.<<<GGF#22N 	 H||$$ 	.--N	.s7   A&/ -/ A&/ A#AA&A##A&c                   K   	 t        j                          |z   }| j                  t        j                  j                  d|       d{   }t        j
                  j                  |      }t        j                  j                  ||       d{   }t        |      dkD  r|| _	        yy7 b7 # t        $ r Y yw xY ww)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.
        svcb)r   Nr   )r"   r7   r   _ddr_local_resolver_namequery
_remaining_get_nameservers_asynclennameserversr)   )r+   r   
expirationr/   r   rb   s         r6   try_ddrzResolver.try_ddr   s     &
	x/J<<--v (  F ii**:6G # ? ? PPK;!##.  $ Q  		sN   C AB1 
B-AB1 B/B1 +C -B1 /B1 1	B=:C <B==C g      @) __name__
__module____qualname____doc__r   r=   rN   r?   r@   r   rE   Namestr	RdataType
RdataClassboolr   intfloatr    Backendr   Answerr7   r   rD   rL   rS   rO   rV   rX   rd        r6   r   r   *   s   )
 7:mmoo9<9J9J $#'$(!%6:?"SXX]]C'(?" cmm--s23?" s~~00#56	?"
 ?" ?" !?" ?" 5/?" ?" #**223?" 
		?"B

"%
14
			
> &&ACHHMM3&'A A 	A
 
	!	!AJsxx}}c/A)B sxx}} *e d rt   r   r   c                  >    t         
t                t         J t         S )zDGet the default asynchronous resolver, initializing it if necessary.)default_resolverreset_default_resolverrs   rt   r6   get_default_resolverrx     s     ''rt   c                      t               ay)zRe-initialize default asynchronous resolver.

    Note that the resolver configuration (i.e. /etc/resolv.conf on UNIX
    systems) will be re-read immediately.
    N)r   rv   rs   rt   r6   rw   rw     s      zrt   FTr   r   r   r   r   r   r   r   r   r   c
                 b   K   t               j                  | |||||||||	
       d{   S 7 w)a  Query nameservers asynchronously to find the answer to the question.

    This is a convenience function that uses the default resolver
    object to make the query.

    See :py:func:`dns.asyncresolver.Resolver.resolve` for more
    information on the parameters.
    N)rx   r7   )
r   r   r   r   r   r   r   r   r   r   s
             r6   r7   r7     sF     * &'//   s   &/-/r8   r9   r:   c                 Z   K    t               j                  | g|i | d{   S 7 w)zUse a resolver to run a reverse query for PTR records.

    See :py:func:`dns.asyncresolver.Resolver.resolve_address` for more
    information on the parameters.
    N)rx   rD   )r8   r9   r:   s      r6   rD   rD   =  s/      8%'77PPPPPPs   "+)+rE   rF   c                 V   K    t               j                  | |fi | d{   S 7 w)zUse a resolver to asynchronously query for address records.

    See :py:func:`dns.asyncresolver.Resolver.resolve_name` for more
    information on the parameters.
    N)rx   rV   )rE   rF   r:   s      r6   rV   rV   I  s,      5%'44T6LVLLLLs    )')c                 P   K   t               j                  |        d{   S 7 w)zDetermine the canonical name of *name*.

    See :py:func:`dns.resolver.Resolver.canonical_name` for more
    information on the parameters and possible exceptions.
    N)rx   rX   )rE   s    r6   rX   rX   U  s"      &'66t<<<<   &$&r   c                 P   K   t               j                  |        d{   S 7 w)a  Try 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.
    N)rx   rd   )r   s    r6   rd   rd   _  s"      &'//8888r~   r   c                 L  K   t        | t              r8t        j                  j	                  | t        j                  j
                        } |
t               }| j                         st        |       	 	 |j                  | t        j                  j                  |||       d{   }|j                  J |j                  j                  | k(  r| S 	 	 | j                         } s7 @# t        t        f$ r Y %w xY w# t        j                  j                   $ r t"        w xY ww)zFind the name of the zone which contains the specified name.

    See :py:func:`dns.resolver.Resolver.zone_for_name` for more
    information on the parameters and possible exceptions.
    N)r   )
isinstancerk   r   rE   	from_textrootrx   is_absoluter   r7   r=   SOArrsetr	   r
   parentNoParentr   )rE   r   r   r   r   r/   s         r6   zone_for_namer   i  s     $xx!!$6')$
		#++cmm''#w ,  F <<++||  D( )
	;;=D  (# 		 xx   	O	sT   A1D$41C( %C&&,C( D$C= %D$&C( (C:7D$9C::D$=$D!!D$5   whereportc                   K   |
t               }g }t        | t              rOt        j                  j                  |       r0|j                  t        j                  j                  | |             n^|j                  | |       d{   }|j                         D ]1  }|j                  t        j                  j                  ||             3 t        j                  j                  d      }||_        |S 7 qw)a  Make 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.asyncresolver.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)	configure)rx   r   rk   r   inet
is_addressappendr1   Do53NameserverrV   	addressesasyncresolverr   rb   )r   r   rF   r   rb   rU   addressress           r6   make_resolver_atr     s     . ')?AK%#(("5"5e"<3>>88EF --eV<<((* 	MGs~~<<WdKL	M



$
$u
$
5C!COJ =s   BC9C7A2C9c                    K   t        | |||       d{   }|j                  |||||||||	|

       d{   S 7 &7 w)a  Query nameservers to find the answer to the question.

    This is a convenience function that calls ``dns.asyncresolver.make_resolver_at()``
    to make a resolver, and then uses it to resolve the query.

    See ``dns.asyncresolver.Resolver.resolve`` for more information on the resolution
    parameters, and ``dns.asyncresolver.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.asyncresolver.make_resolver_at()`` and then use that resolver for the queries
    instead of calling ``resolve_at()`` multiple times.
    N)r   r7   )r   r   r   r   r   r   r   r   r   r   r   r   rF   r   r   s                  r6   
resolve_atr     s[     : !fh?
?C   @s   ?;!?=??)r   Nre   );ri   rL   r"   typingr   r   r   r   r   dns._ddrr   dns.asyncbackenddns.asyncquerydns.exceptiondns.name	dns.querydns.rdataclassdns.rdatatypedns.resolverr	   r
   r   r   
asyncqueryudp_udpr   _tcpr   BaseResolverr   rv   rx   rw   r=   rN   r?   r@   rE   rj   rk   rl   rm   rn   ro   rp   r    rq   rr   r7   rD   rS   rO   rV   rX   rd   r   r   r   rs   rt   r6   <module>r      s  $ &   3 3          D C ~~
~~Ws||(( Wt  h " 36--//58^^5F5F # $!26 #$ #--))3./  3>>,,c12  
	 
 SM      uo  TN  c&&../  	\\ F	Q	Q	Q'*	Q\\	Q 4:3C3C	M
s"
#	M-0	MOR	M\\	M=uSXX]]C%78 =SXX]] =95 94 9 *-):):#'26!
s"
#!^^&&! 
! x 	!
 c&&../! 	XX]]!L ""#'	"#$"
" " x 	"
 "P 36--//58^^5F5F # $!26""#')#$)#$) #--))3./) 3>>,,c12	)
 
) SM) ) ) uo) TN) c&&../) ) ) x ) 	\\)rt   