%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/
Upload File :
Create Path :
Current File : //proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyc

�
�ac@s�dZddlZddlZddlZddlZyddlZWnek
reddlZnXddl	Z
ddlZ
ddlZ
ddl
Z
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlZ
ddlmZmZejdkrNyddlZWnek
rJddlZnXnde
jjfd��YZde
jjfd	��YZe
jj Z d
e
jjfd��YZ!de
jjfd
��YZ"de
jjfd��YZ#de
jjfd��YZ$de
jjfd��YZ%de&fd��YZ'de&fd��YZ(de&fd��YZ)de&fd��YZ*de&fd��YZ+e,a-d�Z.d�Z/e
j0j1e
j2j3e4e,e5d e,d!�Z6e
j2j3e4e,d"�Z7iej8gej96ej:gej;6Z<e,a=ej>Z?ej@ZAejBZCejDZEejFZGejHZIe,e,ejJd d d d#�ZKd d$�ZLe,d%�ZMd&�ZNd'�ZOd(�ZPe,d)�ZQd*�ZRdS(+sDNS stub resolver.i����Ni(txrangetstring_typestwin32tNXDOMAINcBsteZdZddhZdZdd�Zd�Zd�Ze	edd�Zd�Z
d	�Zd
�Zd�Z
RS(
s"The DNS query name does not exist.tqnamest	responsescCs�t|tttf�s'td��nt|�dkrHtd��n|dkr]i}nt|t�s{td��ntd|d|�}|S(Ns#qnames must be a list, tuple or setis(qnames must contain at least one elements(responses must be a dict(qname=response)RR(t
isinstancetlistttupletsettAttributeErrortlentNonetdict(tselfRRtkwargs((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt
_check_kwargs7s	cCsxd|jkr"tt|�j�S|jd}t|�dkrJd}nd}djtt|��}dj||�S(NRisNone of DNS query names exists!The DNS query name does not exists, s{}: {}(	RtsuperRt__str__Rtjointmaptstrtformat(RRtmsg((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRCs
	cCs�d|jkrtd��ntjj}tjj}d}x�|jdD]�}|jd|}xK|jD]@}|j	|ksk|j
|kr�qkn|jdjj
�}qkW|dk	rJtjj|�SqJW|jddS(NRsparametrized exception requiredRi(Rt	TypeErrortdnst
rdataclasstINt	rdatatypetCNAMERtanswertrdtypetrdclasstitemsttargettto_texttnamet	from_text(RRRtcnametqnametresponseR((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pytcanonical_nameNstdocs%Return the unresolved canonical name.cCs�t|jjdg��}t|jjdi��}|jjdi�}xV|jjdg�D]?}||kr�|j|�n||kra||||<qaqaWtd|d|�S(s3Augment by results from another NXDOMAIN exception.RR(RRtgetR
tappendR(Rte_nxtqnames0t
responses0t
responses1tqname1((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt__add__`scCs|jdS(sXAll of the names that were tried.

        Returns a list of ``dns.name.Name``.
        R(R(R((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRlscCs|jdS(s�A map from queried names to their NXDOMAIN responses.

        Returns a dict mapping a ``dns.name.Name`` to a
        ``dns.message.Message``.
        R(R(R((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRsscCs|jd|S(sTThe response for query *qname*.

        Returns a ``dns.message.Message``.
        R(R(RR'((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR({sN(t__name__t
__module__t__doc__tsupp_kwargsRtfmtRRR)tpropertyR2RRR((((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR2s							tYXDOMAINcBseZdZRS(s8The DNS query name is too long after DNAME substitution.(R3R4R5(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR9�stNoAnswercBs*eZdZddZdhZd�ZRS(s<The DNS response does not contain an answer to the question.s,The DNS response does not contain an answer sto the question: {query}R(cKs tt|�jd|dj�S(NtqueryR((RR:t_fmt_kwargstquestion(RR((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR<�s(R3R4R5R7R6R<(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR:�s
	t
NoNameserverscBs7eZdZdZded ZddhZd�ZRS(s�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 ()
    s+All nameservers failed to answer the query.s%s {query}: {errors}i����trequestterrorscKs�g}xM|dD]A}|jdj|d|dr:dnd|d|d��qWtt|�jd	|d
jddj|��S(NR@s Server {} {} port {} answered {}iitTCPtUDPiiR;R?s; (R,RRR>R<R=R(RRtsrv_msgsterr((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR<�s,(R3R4R5RR7R6R<(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR>�s
tNotAbsolutecBseZdZRS(sEAn absolute domain name is required but a relative name was provided.(R3R4R5(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRE�st	NoRootSOAcBseZdZRS(sBThere is no SOA RR at the DNS root name. This should never happen!(R3R4R5(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRF�st
NoMetaqueriescBseZdZRS(s DNS metaqueries are not allowed.(R3R4R5(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRG�stAnswercBsGeZdZed�Zd�Zd�Zd�Zd�Zd�Z	RS(s&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.
    cCsz||_||_||_||_d}d}x5tdd�D]$}yG|j|j|||�}|dks|j|kr�|j}nPWq@t	k
rc|t
jjkrHyj|j|j||t
jj�}	|dks�|	j|kr�|	j}nx|	D]}
|
j
}PqWw@WqHt	k
rD|rEtd|��qEqHXn|rdtd|��qdq@Xq@W|dkr�|r�td|��n||_||_|dkrcx�yp|j|j||t
jj�}|dks�|j|kr�|j}n|dj|kr|dj}nPWq�t	k
r[y|j�}Wq\t
jjk
rWPq\Xq�Xq�Wntj�||_dS(Ni����iiR((R'RR R(RRt
find_rrsetRtttltKeyErrorRRRR"R:R)trrsett	authoritytSOAtminimumtparentR$tNoParentttimet
expiration(RR'RR R(traise_on_no_answertmin_ttlRLtcounttcrrsettrdtsrrset((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt__init__�sf				

	
		
cCs~|dkr|jjS|dkr,|jjS|dkrB|jjS|dkrX|jjS|dkrn|jjSt|��dS(NR$RJtcoversR R(RLR$RJR[R RR
(Rtattr((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt__getattr__s




cCs|jrt|j�pdS(Ni(RLR(R((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt__len__scCs%|jrt|j�p$tt��S(N(RLtiterR(R((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt__iter__scCs#|jdkrt�n|j|S(N(RLRt
IndexError(Rti((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt__getitem__s	cCs&|jdkrt�n|j|=dS(N(RLRRa(RRb((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt__delitem__s	(
R3R4R5tTrueRZR]R^R`RcRd(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRH�s7				tCachecBsAeZdZdd�Zd�Zd�Zd�Zdd�ZRS(s$Simple thread-safe DNS answer cache.g�r@cCs;i|_||_tj�|j|_tj�|_dS(sf*cleaning_interval*, a ``float`` is the number of seconds between
        periodic cleanings.
        N(tdatatcleaning_intervalRRt
next_cleaningt
_threadingtLocktlock(RRh((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRZ$s		cCs�tj�}|j|kr�g}x<|jj�D]+\}}|j|kr1|j|�q1q1Wx|D]}|j|=qgWtj�}||j|_ndS(s&Clean the cache if it's time to do so.N(RRRiRgR!RSR,Rh(Rtnowtkeys_to_deletetktv((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_maybe_clean.s
cCskzV|jj�|j�|jj|�}|dksM|jtj�krQdS|SWd|jj�XdS(s!Get the answer associated with *key*.

        Returns None if no answer is cached for the key.

        *key*, a ``(dns.name.Name, int, int)`` tuple whose values are the
        query name, rdtype, and rdclass respectively.

        Returns a ``dns.resolver.Answer`` or ``None``.
        N(	RltacquireRqRgR+RRSRRtrelease(RtkeyRp((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR+<s

!cCs=z(|jj�|j�||j|<Wd|jj�XdS(s�Associate key and value in the cache.

        *key*, a ``(dns.name.Name, int, int)`` tuple whose values are the
        query name, rdtype, and rdclass respectively.

        *value*, a ``dns.resolver.Answer``, the answer.
        N(RlRrRqRgRs(RRttvalue((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pytputQs
	

cCspz[|jj�|dk	r;||jkrZ|j|=qZni|_tj�|j|_Wd|jj�XdS(sFlush the cache.

        If *key* is not ``None``, only that item is flushed.  Otherwise
        the entire cache is flushed.

        *key*, a ``(dns.name.Name, int, int)`` tuple whose values are the
        query name, rdtype, and rdclass respectively.
        N(RlRrRRgRRRhRiRs(RRt((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pytflushas

	N(	R3R4R5RZRqR+RvRRw(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRf!s
			tLRUCacheNodecBs2eZdZd�Zd�Zd�Zd�ZRS(sLRUCache node.cCs(||_||_||_||_dS(N(RtRutprevtnext(RRtRu((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRZzs			cCs.|j|_||_||j_||_dS(N(RyRz(Rtnode((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pytlink_before�s	cCs.||_|j|_||j_||_dS(N(RyRz(RR{((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt
link_after�s	cCs"|j|j_|j|j_dS(N(RyRz(R((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pytunlink�s(R3R4R5RZR|R}R~(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRxws
			tLRUCachecBsAeZdZdd�Zd�Zd�Zd�Zdd�ZRS(s`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.
    i��cCs;i|_|j|�tdd�|_tj�|_dS(sl*max_size*, an ``int``, is the maximum number of nodes to cache;
        it must be greater than 0.
        N(Rgtset_max_sizeRxRtsentinelRjRkRl(Rtmax_size((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRZ�s	
cCs"|dkrd}n||_dS(Ni(R�(RR�((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR��s	cCs�z}|jj�|jj|�}|dkr2dS|j�|jjtj�kre|j|j	=dS|j
|j�|jSWd|jj�XdS(s!Get the answer associated with *key*.

        Returns None if no answer is cached for the key.

        *key*, a ``(dns.name.Name, int, int)`` tuple whose values are the
        query name, rdtype, and rdclass respectively.

        Returns a ``dns.resolver.Answer`` or ``None``.
        N(
RlRrRgR+RR~RuRSRRRtR}R�Rs(RRtR{((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR+�s


cCs�z�|jj�|jj|�}|dk	rH|j�|j|j=nx?t|j�|jkr�|j	j
}|j�|j|j=qKWt||�}|j|j	�||j|<Wd|jj
�XdS(s�Associate key and value in the cache.

        *key*, a ``(dns.name.Name, int, int)`` tuple whose values are the
        query name, rdtype, and rdclass respectively.

        *value*, a ``dns.resolver.Answer``, the answer.
        N(RlRrRgR+RR~RtRR�R�RyRxR}Rs(RRtRuR{((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRv�s	


cCs�z�|jj�|dk	rW|jj|�}|dk	r�|j�|j|j=q�nL|jj}x4||jkr�|j}d|_	d|_|}qfWi|_Wd|jj
�XdS(sFlush the cache.

        If *key* is not ``None``, only that item is flushed.  Otherwise
        the entire cache is flushed.

        *key*, a ``(dns.name.Name, int, int)`` tuple whose values are the
        query name, rdtype, and rdclass respectively.
        N(RlRrRRgR+R~RtR�RzRyRs(RRtR{Rz((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRw�s


			

N(	R3R4R5RZR�R+RvRRw(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR�s
			tResolvercBs�eZdZded�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
dd�Zejjejjeded
dd�Zdejjd�Zd�Zd�ZRS(sDNS stub resolver.s/etc/resolv.confcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_t|_t|_|j�|r�tjdkr�|j�q�|r�|j|�q�ndS(s�*filename*, a ``text`` or file object, specifying a file
        in standard /etc/resolv.conf format.  This parameter is meaningful
        only when *configure* is true and the platform is POSIX.

        *configure*, a ``bool``.  If True (the default), the resolver
        instance is configured in the normal fashion for the operating
        system the resolver is running on.  (I.e. by reading a
        /etc/resolv.conf file on POSIX systems and from the registry
        on Windows systems.)
        RN(Rtdomaintnameserverstnameserver_portstporttsearchttimeouttlifetimetkeyringtkeynametkeyalgorithmtednst	ednsflagstpayloadtcachetflagstFalsetretry_servfailtrotatetresettsystplatformt
read_registrytread_resolv_conf(Rtfilenamet	configure((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRZ�s.																	

cCs�tjjtjjtj��d�|_t|j�dkrRtjj|_ng|_	i|_
d|_g|_d|_
d|_d|_d|_tjj|_d|_d|_d|_d|_d|_t|_t|_dS(s1Reset all resolver configuration to the defaults.iii5g@g>@i����N(RR$tNameR%tsockettgethostnameR�RtrootR�R�R�R�R�R�RR�R�ttsigtdefault_algorithmR�R�R�R�R�R�R�R�R�(R((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR�#s&+														cCs�t|t�rLyt|d�}Wntk
rBdg|_dSXt}nt}z7x0|D](}t|�dks\|ddks\|ddkr�q\n|j�}t|�dkr�q\n|ddkr�|jj	|d	�q\|dd
krt
jj|d	�|_
q\|ddkrUx`|d	D]"}|jj	t
jj|��q,Wq\|ddkr\d
|d	kr�t|_q�q\q\WWd|r�|j�nXt|j�dkr�|jj	d�ndS(s�Process *f* as a file in the /etc/resolv.conf format.  If f is
        a ``text``, it is used as the name of the file to open; otherwise it
        is treated as the file itself.trs	127.0.0.1Nit#t;it
nameserveriR�R�toptionsR�(RRtopentIOErrorR�ReR�RtsplitR,RR$R%R�R�R�tclose(Rtft
want_closetlttokenstsuffix((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR�;s:
	
2#cCsF|jd�dkrd}n$|jd�dkr<d}nd}|S(Nt it,(tfind(Rtentryt
split_char((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_determine_split_chares		cCsat|�}|j|�}|j|�}x0|D](}||jkr1|jj|�q1q1WdS(N(RR�R�R�R,(RR�R�tns_listtns((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_config_win32_nameserversts
cCstjjt|��|_dS(N(RR$R%RR�(RR�((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_config_win32_domain}scCsmt|�}|j|�}|j|�}x<|D]4}||jkr1|jjtjj|��q1q1WdS(N(RR�R�R�R,RR$R%(RR�R�tsearch_listts((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_config_win32_search�s
cCs�ytj|d�\}}Wntk
r5d}nX|rL|j|�n|sX|r�y2tj|d�\}}|r�|j|�nWq3tk
r�q3Xn�ytj|d�\}}Wntk
r�d}nX|r3|j|�y2tj|d�\}}|r|j|�nWq3tk
r/q3Xnytj|d�\}}Wntk
rhd}nX|r|j|�ndS(Nt
NameServertDomaintDhcpNameServert
DhcpDomaint
SearchList(t_winregtQueryValueExtWindowsErrorRR�R�R�(RRttalways_try_domaintserverstrtypetdomR�((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_config_win32_fromkey�s>








cCsYtjdtj�}t}z,ytj|d�}t}Wn#tk
r_tj|d�}nXz|j|t�Wd|j	�X|rFtj|d�}z�d}x�tr3yotj
||�}|d7}tj||�}|j|||�s�w�nz|j|t�Wd|j	�XWq�tk
r/Pq�Xq�WWd|j	�XnWd|j	�XdS(s9Extract resolver configuration from the Windows registry.s2SYSTEM\CurrentControlSet\Services\Tcpip\Parameterss+SYSTEM\CurrentControlSet\Services\VxD\MSTCPNs=SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfacesii(R�tConnectRegistryRtHKEY_LOCAL_MACHINER�tOpenKeyRetEnvironmentErrorR�tClosetEnumKeyt_win32_is_nic_enabled(Rtlmt	want_scant
tcp_paramst
interfacesRbtguidRt((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR��s@		

	
			


c
Csy�tj|d|�}z�tj|d�\}}|tjkrLt�ntj|d|�}z=tj|d�\}}|tjkr�t�n|d@SWd|j�XWd|j�XWnRttfk
ry&tj|d�\}	}|	dk	SWqt	k
r
t
SXnXdS(Ns]SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\%s\Connectiont
PnpInstanceIDs SYSTEM\CurrentControlSet\Enum\%stConfigFlagsitNTEContextList(R�R�R�tREG_SZt
ValueErrort	REG_DWORDR�R�RR�R�(
RR�R�t
interface_keytconnection_keytpnp_idtttypet
device_keyR�tnte((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR��s6
		
	
cCs�|dkr|jn|}tj�}||}|dkrd|dkr[td|��qd|}n||kr�td|��nt|||j�S(Nii����R�(RR�RRtTimeouttminR�(RtstartR�Rmtduration((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_compute_timeouts
	ic	Cs�t|t�r'tjj|d
�}nt|t�rKtjj|�}ntjj|�rft�nt|t�r�tj	j|�}ntj	j
|�r�t�ng}	|j�r�|	j|�n�t
|�dkr�|	j|jtjj��n|jr.xC|jD]}
|	j|j|
��qWn|	j|j|j��t}i}tj�}
d
}x�|	D]�}|jr�|jj|||f�}|d
k	r�|jd
kr�|r�td|j��q�|Sq�ntjj|||�}|jd
k	r|j|j|jd|j�n|j|j |j!|j"�|j#d
k	rY|j#|_#nd
}|j$}g}|j%r�t&j'|�nd}xl|d
kr�t
|�dkr�t(d|d|��nx�|D]�}|j)|
|�}|j*j||j+�}y�|}|r8tj,j-||||d|d	|�}n|tj,j.||||d|d	|�}|j#tj#j/@r�t}|j)|
|�}tj,j-||||d|d	|�}nWnt0j1tj2j3fk
r�}|j|||||f�d
}q�n�tj,j4k
r;}|j|||||f�d
}q�n�tj2j5k
r�}|j6|�|j|||||f�d
}q�nEt7k
r�}|j6|�|j|||||f�d
}q�nX|j8�}|tj8j9krt9�}|j|||||f�|�n|tj8j:ks:|tj8j;kr>Pn|tj8j<ksZ|j=rj|j6|�n|j|||tj8j>|�|f�d
}q�W|d
k	r�Pnt
|�dkr�|j)|
|�}t?||�}|d
9}tj@|�q�q�W|j8�tj8j;kr%|||<qlntA}PqlW|rNt;d|	d|��ntB|||||�}|jr�|jjC|||f|�n|S(sQuery 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 ``text``, the query name.

        *rdtype*, an ``int`` or ``text``,  the query type.

        *rdclass*, an ``int`` or ``text``,  the query class.

        *tcp*, a ``bool``.  If ``True``, use TCP to make the query.

        *source*, a ``text`` 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 long query should run before timing out.

        Raises ``dns.exception.Timeout`` 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.
        iR(t	algorithmg�������?iR?R@tsourcetsource_portiRRN(DRRRR$R%RRtis_metatypeRGRtis_metaclasstis_absoluteR,RtconcatenateR�R�R�ReRRR�R+RLR:R(tmessaget
make_queryR�tuse_tsigR�R�tuse_ednsR�R�R�R�R�R�trandomtshuffleR>R�R�R�R;ttcptudptTCR�terrort	exceptionR�tUnexpectedSourcet	FormErrortremovetEOFErrortrcodeR9tNOERRORRtSERVFAILR�R#R�tsleepR�RHRv(RR'RR R�R�RTR�R�t
qnames_to_tryR�tall_nxdomaintnxdomain_responsesR�t_qnameRR?R(R�R@tbackoffR�R�R�ttcp_attempttexR�t
sleep_time((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR;"s�-			
	


					





	
	


		cCsJ||_|dkr4t|jj��d|_n	||_||_dS(sAdd a TSIG signature to the query.

        See the documentation of the Message class for a complete
        description of the keyring dictionary.

        *keyring*, a ``dict``, the TSIG keyring to use.  If a
        *keyring* is specified but a *keyname* is not, then the key
        used will be the first key in the *keyring*.  Note that the
        order of keys in a dictionary is not defined, so applications
        should supply a keyname when a keyring is used, unless they
        know the keyring contains only one key.

        *keyname*, a ``dns.name.Name`` or ``None``, the name of the TSIG key
        to use; defaults to ``None``. The key must be defined in the keyring.

        *algorithm*, a ``dns.name.Name``, the TSIG algorithm to use.
        iN(R�RRtkeysR�R�(RR�R�R�((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR��s
		cCs4|dkrd}n||_||_||_dS(s+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.
        i����N(RR�R�R�(RR�R�R�((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR�s
			cCs
||_dS(skOverrides the default flags with your own.

        *flags*, an ``int``, the message flags to use.
        N(R�(RR�((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt	set_flags!sN(R3R4R5ReRZR�R�R�R�R�R�R�R�R�RR�RRtARRR�R;R�R�R�R�R(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR��s&%		*							"	.	7�	cCstdkrt�ntS(s7Get the default resolver, initializing it if necessary.N(tdefault_resolverRtreset_default_resolver(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pytget_default_resolver.s
cCs
t�adS(s�Re-initialize default resolver.

    Note that the resolver configuration (i.e. /etc/resolv.conf on UNIX
    systems) will be re-read immediately.
    N(R�R
(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR5sic	Cs%t�j||||||||�S(s�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.query`` for more information on the
    parameters.
    (RR;(R'RR R�R�RTR�R�((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyR;@scCs�t|t�r-tjj|tjj�}n|dkrEt�}n|j�s`t	|��nx�y8|j
|tjj||�}|j
j|kr�|SWn#tjjtjjfk
r�nXy|j�}Wqctjjk
r�t�qcXqcWdS(scFind the name of the zone which contains the specified name.

    *name*, an absolute ``dns.name.Name`` or ``text``, 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 resolver is used.

    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.)

    Returns a ``dns.name.Name``.
    N(RRRR$R%R�RRR�RER;RRNRLtresolverRR:RPRQRF(R$R R�RR((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt
zone_for_nameQs"cCs|tjtjB@dkr#t�n|dkrP|dkrPtjtj��ng}g}d}y�|dkr�d}|tj@dkr�|jd�|jd�q|jd�|jd�nY|j	d�}	t
|	�dkr�|	d}
n|}
tjj
|
�}|j|�|}Wn�tk
r�y)tjj
|�}|j|�|}Wq�tk
r�|tj@dkr�y$|tjks�|tjkr
tj|tjjd	t�}|j}|jjt�}|jdk	r
x$|jD]}
|j|
j�q�Wq
n|tjks+|tjkr�tj|tjjd	t�}|j}|jjt�}|jdk	r�x$|jD]}
|j|
j�q}Wq�nWq�tj j!k
r�tjtj��q�tk
r�tjtj"��q�Xq�q�XnXd}y%|dkrd}nt#|�}WnNtk
rr|tj$@dkrsytj%|�}Wqotk
rkqoXqsnX|dkr�tjtj��ng}|dkr�tj&tj'g}n	|g}|tj(@dkr�|}nd
}|tjks|tjkrixb|D]W}xN|D]F}x=t)|D]1}|jtj|||||ddff�q)WqWqWn|tjks�|tjkr�x\|D]Q}xH|D]@}x7t)|D]+}|jtj|||||ff�q�Wq�Wq�Wnt
|�dkr
tjtj��n|S(Nit	localhosts::s0.0.0.0s::1s	127.0.0.1t%iRTt(*R�t
AI_ADDRCONFIGtAI_V4MAPPEDtNotImplementedErrorRtgaierrort
EAI_NONAMEt
AI_PASSIVER,R�RRtipv6t	inet_atont	Exceptiontipv4tAI_NUMERICHOSTtAF_INET6t	AF_UNSPECt	_resolverR;RtAAAAR�R'R)R#ReRLtaddresstAF_INETRRRt
EAI_SYSTEMtinttAI_NUMERICSERVt
getservbynamet
SOCK_DGRAMtSOCK_STREAMtAI_CANONNAMEt_protocols_for_socktype(thosttservicetfamilytsocktypetprotoR�tv6addrstv4addrsR)tpartstahosttaddrtv6trdatatv4R�ttuplest	socktypesR&((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_getaddrinfo�s�	








				
!	

		

(

"c
Cs�|d}|d}t|�dkr<|d}tj}nd}tj}t|||tjtjd�}t|�dkr�tjd��n|ddd}|tj	@r�d}nd}t
jj|�}	|tj
@dkr�y/tj|	d�}
|
jdjjt�}Wq�t
jjt
jjfk
r�|tj@rVtjtj��n|}|dk	r�|d	t|�7}q�q�Xn)|}|dk	r�|d	t|�7}n|tj@r�t|�}ntj||�}||fS(
Niiiis'sockaddr resolved to multiple addressesR�R�tPTRR(RR�R RR%R=R+tSOL_TCPR�tNI_DGRAMRtreversenametfrom_addresstNI_NUMERICHOSTR"R;RLR"R#ReRRR:tNI_NAMEREQDRRRtNI_NUMERICSERVt
getservbyport(
tsockaddrR�R.R�tscopeR0R;R7tpnameR'RthostnameR/((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_getnameinfo�sB


	
	

cCsW|dkrtj�}ny#tt|d�dd�dSWntk
rR|SXdS(NiPii(RR�R�RKR=R(R$((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_getfqdns#
cCst|�ddS(Nii(t_gethostbyname_ex(R$((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_gethostbynamescCstg}g}t|dtjtjtjtj�}|dd}x#|D]}|j|dd�qHW|||fS(Niii(R=R�R%R+R?R,R,(R$taliasest	addressesR;t	canonicaltitem((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyRM#s
c
Cs�y/tjj|�|dddf}tj}Wn&tk
rW|df}tj}nXt|tj�\}}g}g}t	|d|tj
tjtj�}|dd}x#|D]}	|j
|	dd�q�W|||fS(NiPiii(RRRR�R RR%RKRDR=R+R?R,R,(
tipRGR0R$R�RORPR;RQRR((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt_gethostbyaddr/s 



cCsX|dkrt�}n|att_tt_tt_	t
t_tt_
tt_dS(s�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(RRR"R=R�tgetaddrinfoRKtgetnameinfoRLtgetfqdnRNt
gethostbynameRMtgethostbyname_exRTt
gethostbyaddr(R((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pytoverride_system_resolverCs					cCs@datt_tt_tt_t	t_
tt_t
t_dS(s5Undo the effects of prior override_system_resolver().N(RR"t_original_getaddrinfoR�RUt_original_getnameinfoRVt_original_getfqdnRWt_original_gethostbynameRXt_original_gethostbyname_exRYt_original_gethostbyaddrRZ(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pytrestore_system_resolver]s					(SR5R�R�RRR�t	threadingRjtImportErrortdummy_threadingt
dns.exceptionRt	dns.flagstdns.ipv4tdns.ipv6tdns.messagetdns.namet	dns.queryt	dns.rcodetdns.rdataclasst
dns.rdatatypetdns.reversenametdns.tsigt_compatRRR�twinregR�R�tDNSExceptionRR9R�R:R>RERFRGtobjectRHRfRxRR�RR
RRRRRRR�ReR;RtSOL_UDPR*R?R+R-R"RUR\RVR]RWR^RXR_RYR`RZRaR!R=RKRLRNRMRTR[Rb(((sA/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/resolver.pyt<module>s�

QgVj��2			+						c(				

Zerion Mini Shell 1.0