OwlCyberSecurity - MANAGER
Edit File: resolver.cpython-312.pyc
� ����\��g ���������������������� ����U�d�Z�ddlZddlZddlZddlZddlZddlZddlZddlm Z m Z mZmZm Z mZmZmZ�ddlmZ�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl!Zddl"Zddl#Zddl$Zddl%ZejL������������������dk(��rddl'Z�G�d��dejP������������������jR�������������������������Z*�G�d��d ejP������������������jR�������������������������Z+ee e,���e-e.ee/e,f���e ej`������������������jb���������������������f���Z2d ee2���dee,���fd�Z3�G�d ��dejP������������������jh�������������������������Z5e5Z4�G�d��dejP������������������jR�������������������������Z6�G�d��dejP������������������jR�������������������������Z7�G�d��dejP������������������jR�������������������������Z8�G�d��dejP������������������jR�������������������������Z9�G�d��dejP������������������jR�������������������������Z:�G�d��dejP������������������jR�������������������������Z;�G�d��d�������Z<�G�d��de=�������Z>�G�d��d e>�������Z?�G�d!��d"�������Z@�G�d#��d$�������ZAeej�������������������j�������������������ej�������������������j�������������������ej�������������������j�������������������f���ZH�G�d%��d&eA�������ZI�G�d'��d(�������ZJ�G�d)��d*eA�������ZK�G�d+��d,�������ZL�G�d-��d.�������ZM�G�d/��d0eM�������ZNdaOe eN���ePd1<���deNfd2�ZQdYd3�ZRej�������������������j�������������������ej�������������������j�������������������d4dd5dddfd6eej�������������������j�������������������e,f���d7eej�������������������j�������������������e,f���d8eej�������������������j�������������������e,f���d9e-d:e e,���d;e-d<e.d=e eU���d>e e-���de<fd?�ZVej�������������������j�������������������ej�������������������j�������������������d4dd5ddfd6eej�������������������j�������������������e,f���d7eej�������������������j�������������������e,f���d8eej�������������������j�������������������e,f���d9e-d:e e,���d;e-d<e.d=e eU���de<fd@�ZWdAe,dBe dCe de<fdD�ZXej�������������������fdEeej�������������������j�������������������e,f���dFe.dCe de?fdG�ZZdEeej�������������������j�������������������e,f���dej�������������������j�������������������fdH�Z[dZd=eUddfdI�Z\ej�������������������j�������������������d4ddfdEeej�������������������j�������������������e,f���d8ej�������������������j�������������������d9e-dJe eN���d=e eU���dej�������������������j�������������������fdK�Z]dLej�������������������dfdMeej�������������������j�������������������e,f���dNe.dFe.dJe eN���deNf dO�Z^ej�������������������j�������������������ej�������������������j�������������������d4dd5ddddLej�������������������dfdMeej�������������������j�������������������e,f���d6eej�������������������j�������������������e,f���d7eej�������������������j�������������������e,f���d8eej�������������������j�������������������e,f���d9e-d:e e,���d;e-d<e.d=e eU���d>e e-���dNe.dFe.dJe eN���de<fdP�Z_ej�������������������ej�������������������gej�������������������ej�������������������giZddaeej�������������������Zgej�������������������Ziej�������������������Zkej�������������������Zmej�������������������Zoej�������������������Zqddej�������������������dddfdQ�Zrd[dR�Zsd\dS�ZtdT��ZudU��ZvdV��Zwd\dJe eN���ddfdW�ZxdYdX�Zyy)]�DNS stub resolver.�����N)�Any�Dict�Iterator�List�Optional�Sequence�Tuple�Union)�urlparse�win32c��������������������n�������e�Zd�ZdZddhZdZ��fd�Zdd�Zdef��fd�Z e d ����������Zd ��Zd��Z d��Zd ��Z��xZS�)�NXDOMAINz"The DNS query name does not exist.�qnames� responsesNc������������������$������t���������|����|i�|���y��N��super�__init__��self�args�kwargs� __class__s��� ��;/opt/hc_python/lib/python3.12/site-packages/dns/resolver.pyr���zNXDOMAIN.__init__?����������� ���$�)�&�)�����c������������������������t��������|t��������t��������t��������f�������st ��������d��������t��������|�������dk(��rt ��������d��������|�i�}nt��������|t���������������st ��������d��������t ��������||��������}|S�)Nz#qnames must be a list, tuple or setr���z(qnames must contain at least one elementz(responses must be a dict(qname=response)�r���r���)� isinstance�list�tuple�set�AttributeError�len�dict)r���r���r���r���s��� r���� _check_kwargszNXDOMAIN._check_kwargsB���si�������&�4���"4�5� �!F�G�G��v�;�!�� �!K�L�L����I��I�t�,� �!K�L�L��V�y�9��� r����returnc�������������������������d|�j�������������������vrt���������|�� ����������S�|�j�������������������d���}t��������|�������dkD��rd}nd}dj ������������������t��������t��������|��������������}|��d|���S�)Nr�������zNone of DNS query names existz!The DNS query name does not existz, z: )r���r����__str__r&����join�map�str)r���r����msgr���s��� �r���r,���zNXDOMAIN.__str__N���se��������4�;�;�&��7�?�$�$����X�&���v�;��?�1�C�5�C����3�s�F�+�,����b���!�!r���c�����������������������d|�j�������������������vrt��������d��������|�j�������������������d���D�].��}|�j�������������������d���|���} �|j��������������������������}||k7��r|c�S��0�|�j�������������������d���d���S�#�t��������$�r�Y��Nw�xY�w)z%Return the unresolved canonical name.r���zparametrized exception requiredr���r���)r���� TypeError�canonical_name� Exception)r����qname�response�cnames��� r���r3���zNXDOMAIN.canonical_nameY���s���������4�;�;�&��=�>�>��[�[��*�E��{�{�;�/��6�H� � �/�/�1���E�>� �L��"� �+���{�{�8�$�Q�'�'�� ��� ��� �s����A,�, A8�7A8c������������������n����t��������|�j������������������j������������������dg���������������}t��������|�j������������������j������������������di���������������}|j������������������j������������������di��������}|j������������������j������������������dg��������D�]$��}||vr|j ������������������|��������||v�s�||���||<����&�t��������||��������S�)z3Augment by results from another NXDOMAIN exception.r���r���r ���)r"���r����getr'����appendr���)r����e_nx�qnames0� responses0� responses1�qname1s��� r����__add__zNXDOMAIN.__add__j���s��������t�{�{���x��4�5���$�+�+�/�/�+�r�:�;� ��[�[�_�_�[�"�5� ��k�k�o�o�h��3�F��W�$����v�&���#�%/��%7� �6�"� �4� ��w�*�=�=r���c������������������ �����|�j�������������������d���S�)zXAll of the names that were tried. Returns a list of ``dns.name.Name``. r����r����r���s��� r���r���zNXDOMAIN.qnamesv���s������ ��{�{�8�$�$r���c������������������ �����|�j�������������������d���S�)z�A map from queried names to their NXDOMAIN responses. Returns a dict mapping a ``dns.name.Name`` to a ``dns.message.Message``. r���rB���rC���s��� r���r���zNXDOMAIN.responses}���s��������{�{�;�'�'r���c������������������&�����|�j�������������������d���|���S�)zTThe response for query *qname*. Returns a ``dns.message.Message``. r���rB���)r���r5���s��� r���r6���zNXDOMAIN.response����s������ ��{�{�;�'��.�.r���r���)�__name__� __module__�__qualname__�__doc__�supp_kwargs�fmtr���r(���r/���r,����propertyr3���r@���r���r���r6���� __classcell__�r���s���@r���r���r���5���sS�������,��[�)�K� �C�*� � "��� "���(���(� >�%�(�/r���r���c�������������������������e�Zd�ZdZy)�YXDOMAINz8The DNS query name is too long after DNAME substitution.N�rF���rG���rH���rI�����r���r���rP���rP�������s������Br���rP����errorsr)���c������������������R�����g�}|�D�]��}|j������������������d|d�����d|d���������������!�|S�)z3Turn a resolution errors trace into a list of text.zServer r���z answered ����)r:���)rS����texts�errs��� r����_errors_to_textrX�������s7�������E��� ���w�s�1�v�h�j��Q���9�:����Lr���c��������������������H�������e�Zd�ZdZdZedd���d�ZddhZ��fd�Z��fd�Z��xZ S�) �LifetimeTimeoutz The resolution lifetime expired.N���z& after {timeout:.3f} seconds: {errors}�timeoutrS���c������������������$������t���������|����|i�|���y�r���r���r���s��� �r���r���zLifetimeTimeout.__init__����r���r���c������������������f������t��������|d����������}t���������|�� ��|d���dj������������������|���������������S�)NrS���r\����; �r\���rS���)rX���r����_fmt_kwargsr-����r���r����srv_msgsr���s��� �r���ra���zLifetimeTimeout._fmt_kwargs����s<�������"�6�(�#3�4���w�"��9�%�d�i�i��.A��#�� �� r���� rF���rG���rH���rI���r0���rK���rJ���r���ra���rM���rN���s���@r���rZ���rZ�������s7�������*� ,�C� ��"�X�J�@� A�C��h�'�K�*� �� r���rZ���c��������������������<�������e�Zd�ZdZdZdhZ��fd�Z��fd�Zd��Z��xZ S�)�NoAnswerz<The DNS response does not contain an answer to the question.zDThe DNS response does not contain an answer to the question: {query}r6���c������������������$������t���������|����|i�|���y�r���r���r���s��� �r���r���zNoAnswer.__init__����r���r���c������������������>������t����������|����|d���j��������������������������S�)Nr6���)�query)r���ra����question)r���r���r���s��� �r���ra���zNoAnswer._fmt_kwargs����s!��������w�"�� �);�)D�)D�"�E�Er���c������������������ �����|�j�������������������d���S�)Nr6���rB���rC���s��� r���r6���zNoAnswer.response����s�������{�{�:�&�&r���) rF���rG���rH���rI���rK���rJ���r���ra���r6���rM���rN���s���@r���rf���rf�������s"�������F� P�C��,�K�*�F�'r���rf���c��������������������H�������e�Zd�ZdZdZedd���d�ZddhZ��fd�Z��fd �Z��xZ 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.Nr[���z {query}: {errors}�requestrS���c������������������$������t���������|����|i�|���y�r���r���r���s��� �r���r���zNoNameservers.__init__����r���r���c������������������z������t��������|d����������}t���������|�� ��|d���j������������������dj ������������������|���������������S�)NrS���rn���r_���)ri���rS���)rX���r���ra���rj���r-���rb���s��� �r���ra���zNoNameservers._fmt_kwargs����sB�������"�6�(�#3�4���w�"���#�,�,�T�Y�Y�x�5H��#�� �� r���rd���rN���s���@r���rm���rm�������s;���������8�C� ��"�X�J�,� -�C��h�'�K�*� �� r���rm���c�������������������������e�Zd�ZdZy)�NotAbsolutezEAn absolute domain name is required but a relative name was provided.NrQ���rR���r���r���rr���rr��������������Or���rr���c�������������������������e�Zd�ZdZy)� NoRootSOAzBThere is no SOA RR at the DNS root name. This should never happen!NrQ���rR���r���r���ru���ru�������s������Lr���ru���c�������������������������e�Zd�ZdZy)� NoMetaqueriesz DNS metaqueries are not allowed.NrQ���rR���r���r���rw���rw�������s������*r���rw���c�������������������������e�Zd�ZdZy)�NoResolverConfigurationzEResolver configuration could not be read or specified no nameservers.NrQ���rR���r���r���ry���ry�������rs���r���ry���c��������������������>����e�Zd�ZdZ � �ddej ������������������j������������������dej������������������j������������������dej������������������j������������������dej������������������j������������������de e���de e���d dfd �Zd��Zd efd�Zd eej(������������������j*���������������������fd �Zd��Zd��Zy)�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. Nr5����rdtype�rdclassr6���� nameserver�portr)���c������������������N����||�_���������||�_��������||�_��������||�_��������||�_��������||�_��������|j ��������������������������|�_��������|�j������������������j������������������|�_��������|�j������������������j������������������|�_ ��������t��������j��������������������������|�j������������������j������������������z���|�_ ��������y�r���)r5���r|���r}���r6���r~���r����resolve_chaining�chaining_resultr3����answer�rrset�time�minimum_ttl� expiration)r���r5���r|���r}���r6���r~���r���s��� r���r���zAnswer.__init__��s���������� ������� �� �$����� �'�8�8�:����#�2�2�A�A����)�)�0�0�� ��)�)�+��(<�(<�(H�(H�H��r���c������������������&����|dk(��r|�j�������������������j������������������S�|dk(��r|�j�������������������j������������������S�|dk(��r|�j�������������������j������������������S�|dk(��r|�j�������������������j������������������S�|dk(��r|�j�������������������j ������������������S�t ��������|��������)N�name�ttl�coversr}���r|���)r����r����r����r����r}���r|���r%���)r����attrs��� r����__getattr__zAnswer.__getattr__��s�������6�>��:�:�?�?�"� �U�]��:�:�>�>�!� �X� ��:�:�$�$�$� �Y� ��:�:�%�%�%� �X� ��:�:�$�$�$� ��&�&r���c������������������P�����|�j�������������������xr�t��������|�j��������������������������xs�dS��Nr���)r����r&���rC���s��� r����__len__zAnswer.__len__*��s�������z�z�-�c�$�*�*�o�2��2r���c������������������r�����|�j�������������������xr�t��������|�j��������������������������xs�t��������t�����������������������S�r���)r�����iterr#���rC���s��� r����__iter__zAnswer.__iter__-��s%�������z�z�.�d�4�:�:�.�?�$�u�w�-�?r���c������������������D�����|�j��������������������t���������|�j�������������������|���S�r����r����� IndexError�r����is��� r����__getitem__zAnswer.__getitem__0��s �������:�:�����z�z�!�}�r���c������������������B�����|�j��������������������t���������|�j�������������������|=�y�r���r����r����s��� r����__delitem__zAnswer.__delitem__5��s�������:�:�����J�J�q�Mr����NN)rF���rG���rH���rI����dnsr�����Name� rdatatype� RdataType� rdataclass� RdataClass�message�QueryMessager���r/����intr���r����r����r����rdata�Rdatar����r����r����rR���r���r���r{���r{�������s������� �*�%)�"�I��x�x�}�}�I��� � �'�'�I�����*�*� I� ��+�+�*�*�I���S�M� I���s�m�I�� �I�,'�3���3�@�(�3�9�9�?�?�3��@�� r���r{���c�������������������������e�Zd�ZdZy)�Answersz5A dict of DNS stub resolver answers, indexed by type.NrQ���rR���r���r���r����r����;��s������?r���r����c������������ ��������������e�Zd�ZdZe � � �ddee���dee���dedd�fd���������Ze j������������������fdedee eef������fd �Ze j������������������fdedee���fd �Zdej$������������������j&������������������fd�Zy) �HostAnswerszTA dict of DNS stub resolver answers to a host name lookup, indexed by type. N�v6�v4� add_emptyr)���c������������������������t����������������}|�+|s|j������������������r||t��������j������������������j������������������<���|�+|s|j������������������r||t��������j������������������j ������������������<���|S�r���)r����r����r����r�����AAAA�A)�clsr����r����r�����answerss��� r����makezHostAnswers.makeD��sP��������-�� �>�y�B�H�H�*,�G�C�M�M�&�&�'� �>�y�B�H�H�')�G�C�M�M�O�O�$��r����familyc��������������#������K����|t���������j������������������k(��rO|�j������������������t���������j�������������������������E�d�{�������|�j������������������t���������j�������������������������E�d�{�������y�|t���������j������������������k(��r*|�j������������������t��������j������������������j�������������������������}nK|t���������j������������������k(��r*|�j������������������t��������j������������������j�������������������������}nt��������d|�����������|r|D�]��}|j������������������|f�����y�y�7���7����w)N�unknown address family )�socket� AF_UNSPEC�addresses_and_families�AF_INET6�AF_INETr9���r����r����r����r�����NotImplementedError�address)r���r����r����r����s��� r���r����z"HostAnswers.addresses_and_familiesT��s������������V�%�%�%��2�2�6�?�?�C�C�C��2�2�6�>�>�B�B�B�� �v��� &��X�X�c�m�m�0�0�1�F� �v�~�~� %��X�X�c�m�m�o�o�.�F�%�(?��x�&H�I�I�����}�}�f�-�-�� ���� D��B�s"����6D�D�&D�D � B)D� Dc������������������2�����d��|�j������������������|�������D���������S�)Nc��������������3����&���K����|�] ��}|d���������y�w)r���NrR���)�.0�pairs��� r���� <genexpr>z(HostAnswers.addresses.<locals>.<genexpr>h��s���������H�$G�D��Q��$G�s����)r����)r���r����s��� r���� addresseszHostAnswers.addressesg��s������H�D�$?�$?��$G�H�Hr���c�����������������������|�j������������������t��������j������������������j������������������|�j������������������t��������j������������������j��������������������������������}|j ������������������S�r���)r9���r����r����r����r����r3���)r���r����s��� r���r3���zHostAnswers.canonical_namek��s9���������#�-�-�,�,�d�h�h�s�}�}���.G�H���$�$�$r���)NNT)rF���rG���rH���rI����classmethodr���r{����boolr����r����r����r����r���r ���r/���r����r����r����r����r����r3���rR���r���r���r����r����?��s����������� $�#�� ��V���� �V����� � � ����� �#�,�,�.��.� �%��S��/� "�.�&�'-�&6�&6��I���I�8�C�=��I�%���� � ��%r���r����c��������������������6�����e�Zd�ZdZd dededdfd�Zd d�Zdd�Zy)�CacheStatisticszCache Statistics�hits�missesr)���Nc������������������ �����||�_���������||�_��������y�r����r����r����)r���r����r����s��� r���r���zCacheStatistics.__init__s��s�������� ���r���c������������������ �����d|�_���������d|�_��������y�r����r����rC���s��� r����resetzCacheStatistics.resetw��s�������� ���r���c������������������B�����t��������|�j������������������|�j�������������������������S�r���)r����r����r����rC���s��� r����clonezCacheStatistics.clone{��s�������t�y�y�$�+�+�6�6r���)r���r����r)���N)r)���r����)rF���rG���rH���rI���r����r���r����r����rR���r���r���r����r����p��s)��������S���c���$����7r���r����c��������������������@�����e�Zd�Zdd�Zdd�Zdefd�Zdefd�Zdefd�Z y) � CacheBaser)���Nc������������������T�����t��������j��������������������������|�_��������t����������������|�_��������y�r���)� threading�Lock�lockr����� statisticsrC���s��� r���r���zCacheBase.__init__���s�������N�N�$�� �)�+��r���c������������������z�����|�j�������������������5��|�j������������������j���������������������������ddd��������y#�1�sw�Y���yxY�w)zReset all statistics to zero.N)r����r����r����rC���s��� r����reset_statisticszCacheBase.reset_statistics���s#������ �Y�Y��O�O�!�!�#���Y�Y�s����1�:c������������������r�����|�j�������������������5��|�j������������������j������������������cddd��������S�#�1�sw�Y���yxY�w)z How many hits has the cache had?N)r����r����r����rC���s��� r���r����zCacheBase.hits���s ������ �Y�Y��?�?�'�'���Y�Y������-�6c������������������r�����|�j�������������������5��|�j������������������j������������������cddd��������S�#�1�sw�Y���yxY�w)z"How many misses has the cache had?N)r����r����r����rC���s��� r���r����zCacheBase.misses���s ������ �Y�Y��?�?�)�)���Y�Y�r����c������������������z�����|�j�������������������5��|�j������������������j��������������������������cddd��������S�#�1�sw�Y���yxY�w)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����rC���s��� r����get_statistics_snapshotz!CacheBase.get_statistics_snapshot���s%��������Y�Y��?�?�(�(�*���Y�Y�s����1�:r����) rF���rG���rH���r���r����r����r����r����r����r����rR���r���r���r����r������s0������,�$� (�c��(� *���*� +���+r���r����c��������������������x�������e�Zd�ZdZddeddf��fd� Zd d�Zdedee ���fd�Z ded e ddfd �Zddee���ddfd�Z��xZ S�)�Cachez$Simple thread-safe DNS answer cache.�cleaning_intervalr)���Nc������������������������t����������|�������������i�|�_��������||�_��������t ��������j��������������������������|�j������������������z���|�_��������y)zf*cleaning_interval*, a ``float`` is the number of seconds between periodic cleanings. N)r���r����datar����r����� next_cleaning)r���r����r���s��� �r���r���zCache.__init__���s8������� � ����,.�� �!2���$(�I�I�K�$�2H�2H�$H��r���c������������������N����t��������j���������������������������}|�j������������������|k��r�g�}|�j������������������j��������������������������D�]&��\��}}|j������������������|k��s�|j������������������|���������(�|D�]��}|�j������������������|=���t��������j���������������������������}||�j������������������z���|�_��������yy)z&Clean the cache if it's time to do so.N)r����r����r�����itemsr����r:���r����)r����now�keys_to_delete�k�vs��� r����_maybe_cleanzCache._maybe_clean���s���������i�i�k������$��N�� � ���)���1��<�<�3�&�"�)�)�!�,��*��$���I�I�a�L��$��)�)�+�C�!$�t�'=�'=�!=�D���%r����keyc������������������v����|�j�������������������5��|�j���������������������������|�j������������������j������������������|�������}|�!|j������������������t��������j ��������������������������k��r)|�j������������������xj������������������dz ��c_�������� �ddd��������y|�j������������������xj������������������dz ��c_��������|cddd��������S�#�1�sw�Y���yxY�w�aK��Get 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����r9���r����r����r����r����r����)r���r����r����s��� r���r9���z Cache.get���s���������Y�Y������ � � � �c�"�A��y�A�L�L�D�I�I�K�7����&�&�!�+�&����Y�� �O�O� � �A�%� ����Y�Y�s����A/B/� B/�/B8�valuec�����������������������|�j�������������������5��|�j���������������������������||�j������������������|<���ddd��������y#�1�sw�Y���yxY�w�a��Associate 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�����r���r����r����s��� r����putz Cache.put���s.��������Y�Y�����"�D�I�I�c�N���Y�Y�s���� 6�?c������������������������|�j�������������������5��|�||�j������������������v�r;|�j������������������|=�n-i�|�_��������t��������j��������������������������|�j������������������z���|�_��������ddd��������y#�1�sw�Y���yxY�w�a2��Flush 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����)r���r����s��� r����flushzCache.flush���sQ��������Y�Y����$�)�)�#�� � �#���� �%)�Y�Y�[�4�3I�3I�%I��"� ��Y�Y�s����AA"�"A+)g������r@r����r���)rF���rG���rH���rI����floatr���r�����CacheKeyr���r{���r9���r����r����rM���rN���s���@r���r����r�������sn�������.�I�%��I�D��I�>��x���H�V�$4���(#�x��#���#�4��#�J��(�+��J�t��Jr���r����c��������������������&�����e�Zd�ZdZd��Zdd�Zdd�Zy)�LRUCacheNodezLRUCache node.c������������������J�����||�_���������||�_��������d|�_��������|�|�_��������|�|�_��������y�r����)r����r����r�����prev�nextr����s��� r���r���zLRUCacheNode.__init__���s%����������� ��� ��� ��� r���Nc������������������d�����||�_���������|j������������������|�_��������|�|j������������������_���������|�|_��������y�r����r����r����)r����nodes��� r���� link_afterzLRUCacheNode.link_after���s&�������� ��I�I�� ��� � ���� r���c������������������p�����|�j�������������������|�j������������������_���������|�j������������������|�j�������������������_��������y�r���r��rC���s��� r����unlinkzLRUCacheNode.unlink���s ���������� � ������ � �r���)r��r����r)���Nr����)rF���rG���rH���rI���r���r��r��rR���r���r���r����r�������s���������#r���r����c���������������������������e�Zd�ZdZd deddf��fd� Zdeddfd�Zdedee ���fd�Z dedefd �Zded e ddfd�Zddee���ddfd�Z ��xZS�)�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. �max_sizer)���Nc�������������������������t����������|�������������i�|�_��������|�j������������������|��������t ��������dd�������|�_��������|�j ������������������|�j ������������������_��������|�j ������������������|�j ������������������_��������y)zl*max_size*, an ``int``, is the maximum number of nodes to cache; it must be greater than 0. N)r���r���r�����set_max_sizer�����sentinelr����r����)r���r��r���s��� �r���r���zLRUCache.__init__��sS������� � ����24�� ����(�#�&2�4��&>�� �!�]�]�� � ��!�]�]�� � �r���c������������������ �����|dk��rd}||�_���������y�)Nr+���)r��)r���r��s��� r���r ��zLRUCache.set_max_size��s�������a�<��H� �� r���r����c������������������~����|�j�������������������5��|�j������������������j������������������|�������}|�)|�j������������������xj������������������dz ��c_�������� �ddd��������y|j���������������������������|j������������������j������������������t��������j��������������������������k��r@|�j������������������|j������������������=�|�j������������������xj������������������dz ��c_�������� �ddd��������y|j������������������|�j��������������������������|�j������������������xj������������������dz ��c_��������|xj������������������dz ��c_��������|j������������������cddd��������S�#�1�sw�Y���yxY�wr����) r����r����r9���r����r����r��r����r����r����r����r��r��r�����r���r����r��s��� r���r9���zLRUCache.get ��s���������Y�Y��9�9�=�=��%�D��|����&�&�!�+�&�� ��Y�� �K�K�M��z�z�$�$�� � ��3��I�I�d�h�h�'����&�&�!�+�&����Y�� �O�O�D�M�M�*��O�O� � �A�%� ��I�I��N�I��:�:���Y�Y�s����>D3�A2D3�AD3�3D<c����������������������|�j�������������������5��|�j������������������j������������������|�������}|�+|j������������������j������������������t��������j ��������������������������k��r �ddd��������y|j������������������cddd��������S�#�1�sw�Y���yxY�w)zBReturn the number of cache hits associated with the specified key.Nr���)r����r����r9���r����r����r����r����r��s��� r����get_hits_for_keyzLRUCache.get_hits_for_key<��sT������ �Y�Y��9�9�=�=��%�D��|�t�z�z�4�4�� � ��C����Y� ��y�y���Y�Y�s����A A5� A5�5A>r����c������������������>����|�j�������������������5��|�j������������������j������������������|�������}|�'|j���������������������������|�j������������������|j������������������=�t��������|�j�������������������������|�j������������������k\��r`|�j������������������j������������������}|j���������������������������|�j������������������|j������������������=�t��������|�j�������������������������|�j������������������k\��r�`t��������||�������}|j������������������|�j��������������������������||�j������������������|<���ddd��������y#�1�sw�Y���yxY�wr����)r����r����r9���r��r����r&���r��r��r����r����r��)r���r����r����r���gnodes��� r���r����zLRUCache.putE��s���������Y�Y��9�9�=�=��%�D������ ��I�I�d�h�h�'��d�i�i�.�D�M�M�1�� � �*�*�������I�I�e�i�i�(���d�i�i�.�D�M�M�1�� ��U�+�D��O�O�D�M�M�*�!�D�I�I�c�N���Y�Y�s����CD�6D�Dc����������������������|�j�������������������5��|�E|�j������������������j������������������|�������}|��|j���������������������������|�j������������������|j������������������=�nZ|�j ������������������j������������������}||�j ������������������k7��r.|j������������������}|j���������������������������|}||�j ������������������k7��r�.i�|�_��������ddd��������y#�1�sw�Y���yxY�wr����)r����r����r9���r��r����r��r����)r���r����r��r��r����s��� r���r����zLRUCache.flush[��s���������Y�Y����y�y�}�}�S�)���#��K�K�M�� � �$�(�(�+�� � �*�*���t�}�}�,� �:�:�D��L�L�N� �E���t�}�}�,���� ���Y�Y�s����BB8�(B8�8C)i���r���)rF���rG���rH���rI���r����r���r ��r����r���r{���r9���r��r����r����rM���rN���s���@r���r��r����s��������� +��� +�$�� +�!�S��!�T��!� �x���H�V�$4���8!�H��!���!�"�x��"���"�4��"�,��(�+���t��r���r��c������������������������e�Zd�ZdZdddeej������������������j������������������ef���deej������������������j������������������ef���deej������������������j������������������ef���de de d ee ���d dfd�Zd eeej"������������������j$���������������������ee���f���fd �Zd eej*������������������j,������������������e ef���fd�Zdeej"������������������j2���������������������dee���d eee���e f���fd�Zy)�_Resolutiona��Helper class for dns.resolver.Resolver.resolve(). All of the "business logic" of resolution is encapsulated in this class, allowing us to have multiple resolve() implementations using different I/O schemes without copying all of the complicated logic. This class is a "friend" to dns.resolver.Resolver and manipulates resolver data structures directly. �resolver�BaseResolverr5���r|���r}����tcp�raise_on_no_answer�searchr)���Nc�����������������������t��������|t���������������r t��������j������������������j ������������������|d��������}t��������j ������������������j������������������j������������������|�������}t��������j ������������������j������������������|�������rt���������t��������j������������������j������������������j������������������|�������}t��������j������������������j������������������|�������rt���������||�_ ��������|j������������������||�������|�_��������|�j������������������d�d��|�_��������||�_��������||�_��������||�_��������||�_��������i�|�_��������t��������j������������������j,������������������|�_��������g�|�_��������g�|�_��������g�|�_��������d�|�_��������d|�_��������d|�_��������d�|�_��������d|�_��������y�)NF���������) r!���r/���r����r����� from_textr����r����r�����is_metatyperw���r����r�����is_metaclassr���_get_qnames_to_try� qnames_to_tryr���r|���r}���r��r���nxdomain_responses�emptyr5����nameservers�current_nameserversrS���r~����tcp_attempt�retry_with_tcprn����backoff)r���r��r5���r|���r}���r��r��r��s��� r���r���z_Resolution.__init__���s&�������e�S�!��H�H�&�&�u�d�3�E����(�(�-�-�f�5���=�=�$�$�V�,����.�.�+�+�0�0��9���>�>�&�&�w�/��� �� �%�8�8���G����(�(��+������������"4���QS����X�X�^�^�� �<>���DF�� �(*���?C��� ���#���;?�����r���c������������������X����t��������|�j�������������������������dkD���rq|�j������������������j������������������d�������|�_��������|�j������������������j �������������������r*|�j������������������j ������������������j ������������������|�j������������������|�j������������������|�j������������������f�������}|�2|j�������������������"|�j������������������rt��������|j���������������������������d|fS�|�j������������������j ������������������j ������������������|�j������������������t��������j������������������j������������������|�j������������������f�������}|�Z|j������������������j!��������������������������t��������j ������������������j"������������������k(��r%|j������������������|�j$������������������|�j������������������<�����zt��������j&������������������j)������������������|�j������������������|�j������������������|�j�������������������������}|�j������������������j*�������������������P|j-������������������|�j������������������j.������������������|�j������������������j*������������������|�j������������������j0���������������������������|j3������������������|�j������������������j4������������������|�j������������������j6������������������|�j������������������j8������������������|�j������������������j:���������������������������|�j������������������j<�������������������|�j������������������j<������������������|_��������|�j������������������j?������������������|�j������������������j@������������������|�j������������������jB������������������|�j������������������jD�������������������������|�_#��������|�j������������������jH������������������rtK��������jL������������������|�jF��������������������������|�jF������������������dd�|�_'��������g�|�_(��������d|�_)��������d|�_*��������d|�_+��������||�_,��������d|�_-��������|dfS�t#��������|�j\������������������|�j$���������������������������) z�Get the next request to send, and check the cache. Returns a (request, answer) tuple. At most one of request or answer will not be None. r���N�r6���)� algorithm)�optionsFg�������?r ���)/r&���r����popr5���r���cacher9���r|���r}���r����r��rf���r6���r����r�����ANY�rcoder���r"��r����� make_query�keyname�use_tsig�keyring�keyalgorithm�use_edns�edns� ednsflags�payload�ednsoptions�flags�_enrich_nameservers�_nameservers�nameserver_portsr���r$���rotate�random�shuffler%��rS���r~���r&��r'��rn���r(��r!��)r���r����rn���s��� r����next_requestz_Resolution.next_request���s��������$�+�+���"�������+�D�J���}�}�"�"����,�,�0�0��Z�Z����d�l�l�;�����%��|�|�+��0G�0G�&����@�@� $�f�~�-����,�,�0�0��Z�Z����!2�!2�D�L�L�A�����%�&�/�/�*?�*?�*A�S�Y�Y�EW�EW�*W��;A�/�/�D�+�+�D�J�J�7����k�k�,�,�T�Z�Z����d�l�l�S�G��}�}�$�$�0�� � ��M�M�)�)��M�M�)�)�"�m�m�8�8��!��� � ���� � �"�"�� � �'�'�� � �%�%�� � �1�1� � �� ���}�}�"�"�.� $� � � 3� 3�� �#�}�}�@�@�� � �*�*�� � �.�.�� � �"�"� �D�� ��}�}�#�#����t�/�/�0�'+�'7�'7��':�D�$��D�K�"�D�O�$�D��"'�D��"�D�L��D�L��T�?�"���d�0�0�D�<S�<S�T�Tr���c������������������~����|�j�������������������rG|�j�������������������J��|�j������������������j��������������������������rJ��d|�_��������d|�_���������|�j������������������ddfS�d}|�j������������������swt��������|�j�������������������������dk(��r!t��������|�j������������������|�j���������������������������|�j������������������d�d��|�_��������|�j������������������}t��������|�j������������������dz��d�������|�_ ��������|�j������������������j������������������d�������|�_��������|�j������������������xs�|�j������������������j��������������������������|�_��������|�j������������������|�j������������������|fS�)NTFr���r��)rn���rS�������)r'��r~����is_always_max_sizer&��r%��r&���r$��rm���rn���rS���r(���minr-��r��)r���r(��s��� r����next_nameserverz_Resolution.next_nameserver���s���������?�?�.�.�.����9�9�;�;�;�#�D��"'�D���O�O�T�1�-�-����'�'��4�#�#�$��)�#�D�L�L����M�M�'+�'7�'7��':�D�$��l�l�G��t�|�|�a�/��3�D�L��2�2�6�6�q�9����8�8�K�t���'I�'I�'K�������!1�!1�7�;�;r���r6����exc����������� �����������|�j��������������������J��|�r1|�J��|�j������������������j������������������t��������|�j��������������������������|�j������������������|�j�������������������j��������������������������||f��������t ��������|t��������j������������������j�������������������������s0t ��������|t���������������s t ��������|t���������������st ��������|t���������������r&|�j������������������j������������������|�j���������������������������yt ��������|t��������j������������������j �������������������������r9|�j������������������r&|�j������������������j������������������|�j���������������������������yd|�_��������y|�J��t ��������|t��������j������������������j$�������������������������sJ��|j'��������������������������}|t��������j&������������������j(������������������k(��r� �t+��������|�j,������������������|�j.������������������|�j0������������������||�j�������������������j3��������������������������|�j�������������������j���������������������������������}|�j6������������������j8������������������rG|�j6������������������j8������������������j;������������������|�j,������������������|�j.������������������|�j0������������������f|��������|j<�������������������"|�j>������������������rtA��������|jB���������������������������|dfS�|t��������j&������������������jD������������������k(��r� �t+��������|�j,������������������t��������jF������������������jH������������������t��������jJ������������������jL������������������|�������}||�jN������������������|�j,������������������<���|�j6������������������j8������������������rU|�j6������������������j8������������������j;������������������|�j,������������������t��������jF������������������jH������������������|�j0������������������f|��������y|t��������j&������������������jP������������������k(��ratQ����������������}|�j������������������j������������������t��������|�j��������������������������|�j������������������|�j�������������������j��������������������������||f��������|�|t��������j&������������������jR������������������k7��s|�j6������������������jT������������������s%|�j������������������j������������������|�j���������������������������|�j������������������j������������������t��������|�j��������������������������|�j������������������|�j�������������������j��������������������������t��������j&������������������jW������������������|�������|f��������y#�t4��������$�r�}|�j������������������j������������������t��������|�j��������������������������|�j������������������|�j�������������������j��������������������������||f��������|�j������������������j������������������|�j���������������������������Y�d�}~yd�}~ww�xY�w#�t4��������$�r�}|�j������������������j������������������t��������|�j��������������������������|�j������������������|�j�������������������j��������������������������||f��������|�j������������������j������������������|�j���������������������������Y�d�}~yd�}~ww�xY�w)NT)NFr*��)NT),r~���rS���r:���r/���r&���answer_portr!���r����� exception� FormError�EOFError�OSErrorr����r$���remover����� Truncatedr'��r����r0���NOERRORr{���r5���r|���r}����answer_nameserverr4���r��r.��r����r����r��rf���r6���r���r����r/��r�����INr"��rP����SERVFAIL�retry_servfail�to_text)r���r6���rH��r0��r�����e�yexs��� r����query_resultz_Resolution.query_result��sg���������*�*�*� ��#�#�#��K�K�������(��$�$��O�O�/�/�1���� ���2�s�}�}�6�6�7��b�(�+��b�'�*��b�"5�6��� � �'�'����8��!� ��B���� 5� 5�6��#�#��$�$�+�+�D�O�O�<��!��+/�D�'� ��#�#�#��(�C�K�K�$<�$<�=�=�=���� ���C�I�I�%�%�%� %���J�J��K�K��L�L���O�O�5�5�7��O�O�/�/�1� ��*��}�}�"�"�� � �#�#�'�'����T�[�[�$�,�,�(O�QW�X��|�|�#��(?�(?�����8�8��D�>�!� �c�i�i�(�(� (� %���J�J�� � � 1� 1�3�>�>�3D�3D�h��� �3;�D�#�#�D�J�J�/��}�}�"�"�� � �#�#�'�'��Z�Z����!2�!2�D�L�L�A�6�� � � �c�i�i�(�(� (��*�C��K�K�������(��$�$��O�O�/�/�1���� ���I���� � �*�*�*�$�-�-�2N�2N�� � �'�'����8��K�K�������(��$�$��O�O�/�/�1��I�I�%�%�e�,��� ��!��U��� %����"�"��D�O�O�,��(�(����3�3�5�� ����� � �'�'����8�$�� %��2��� %����"�"��D�O�O�,��(�(����3�3�5�� ����� � �'�'����8�$�� %�s4����AR<��&AU��< U �A:U�U � W�A:W�W)rF���rG���rH���rI���r���r����r����r����r/���r����r����r����r����r����r���r���r ���r����r����r{���rB��r~���� Nameserverr����rG���Messager4���rY��rR���r���r���r��r��t��s/����� �#� �#���S�X�X�]�]�C�'�(�#���c�m�m�-�-�s�2�3� #� ��s�~�~�0�0�#�5�6�#��� #��!�#�����#�� �#�JIU� �x����0�0�1�8�F�3C�C� D�IU�V<��s�~�~�'@�'@�$��'M�!N��<�*z!� ����!4�!4�5�z!�;C�I�;N�z!� �x����%� &�z!r���r��c������������������������e�Zd�ZU�dZej ������������������j������������������ed<���ee e f���ed<���e ed<���eej ������������������j���������������������ed<���eed<���e ed<���e ed<���ee���ed <���eeej ������������������j������������������e f������ed <���eej ������������������j������������������e f���ed<���e ed<���e ed <���eeej"������������������j$������������������������ed<���e ed<���eed<���ee ���ed<���eed<���eed<���ee ���ed<���eee ej(������������������j*������������������f������ed<��� �d/de deddfd�Zd0d�Zdeddfd�Zd0d�Z � �d1de dee ���d eee������de fd!�Zd"ej ������������������j������������������dee���deej ������������������j���������������������fd#�Zdej:������������������j<������������������fd ed eeej ������������������j������������������e f������d$eej ������������������j������������������e f���ddfd%�Zd&d&ej@������������������jB������������������dfdeee ef������d e de d'eeej"������������������j$������������������������ddf d(�Z"de ddfd)�Z#e$d*eee ej(������������������j*������������������f������dee e f���d+e deej(������������������j*���������������������fd,���������Z%e&deee ej(������������������j*������������������f������fd-���������Z'e'jP������������������d*eee ej(������������������j*������������������f������ddfd.���������Z'y)2r��r����domainr>��r���r���use_search_by_defaultr\����lifetimer4��r2��r5��r7��r8��r:��r9��r.��r;��rU��r?���ndotsr=���filename� configurer)���Nc�����������������������|�j���������������������������|r9t��������j������������������dk(��r|�j���������������������������y|r|�j ������������������|��������yyy)a���*filename*, a ``str`` 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.) r ���N)r�����sys�platform� read_registry�read_resolv_conf)r���ra��rb��s��� r���r���zBaseResolver.__init__���sC������� � � ����|�|�w�&��"�"�$���%�%�h�/����r���c������������������X����t���������j������������������j������������������t���������j������������������j������������������t ��������j ���������������������������������dd��������|�_��������t��������|�j�������������������������dk(��rt���������j������������������j������������������|�_��������g�|�_ ��������i�|�_ ��������d|�_��������g�|�_��������d|�_ ��������d|�_��������d|�_��������d|�_��������d|�_��������t���������j$������������������j&������������������|�_��������d|�_��������d|�_��������d|�_��������d|�_��������d|�_��������d|�_��������d|�_��������d|�_��������d|�_��������y) z1Reset all resolver configuration to the defaults.r+���Nr����5���Fg�������@�������@r[���)r����r����r����r��r�����gethostnamer]��r&����rootr=��r>��r���r��r^��r\���r_��r4��r2���tsig�default_algorithmr5��r7��r8��r:��r9��r.��r;��rU��r?��r`��rC���s��� r���r����zBaseResolver.reset���s���������h�h�m�m�C�H�H�$6�$6�v�7I�7I�7K�$L�Q�R�$P�Q����t�{�{��q� ��(�(�-�-�D�K���� "����� ����%*��"������ ��������H�H�6�6����� ������������ ��� �#�������� r����fc������������������L����g�}t��������|t���������������r �t��������|�������}nt��������j������������������|�������}|5�}|D��]m��}t��������|�������dk(��s|d���dk(��s|d���dk(��r�#|j��������������������������}t��������|�������dk��r�B|d���dk(��r|j������������������|d������������_|d���dk(��r/t��������j������������������j������������������|d����������|�_ ��������g�|�_����������|d���d k(��rJg�|�_��������|dd �D�]:��}|�j������������������j������������������t��������j������������������j������������������|����������������<���|d���dk(��s��|dd �D�]u��}|dk(��rd |�_���������|dk(��r|�j!����������������������������&d|v�r$ �t#��������|j������������������d�������d����������|�_���������Nd|v�s�S �t#��������|j������������������d�������d����������|�_���������w���p� �d d d ��������t��������|�������dk(��rt ��������d��������||�_��������y #�t��������$�r�t ��������d|�����������w�xY�w#�t&��������t(��������f$�r�Y���w�xY�w#�t&��������t(��������f$�r�Y���w�xY�w#�1�sw�Y����oxY�w)a���Process *f* as a file in the /etc/resolv.conf format. If f is a ``str``, it is used as the name of the file to open; otherwise it is treated as the file itself. Interprets the following items: - nameserver - name server IP address - domain - local domain name - search - search list for host-name lookup - options - supported options are rotate, timeout, edns0, and ndots zcannot open r����#�;rD��r~���r+���r]��r��Nr,��r?��T�edns0r\����:r`��zno nameservers)r!���r/����openrN��ry���� contextlib�nullcontextr&����splitr:���r����r����r��r]��r��r?��r6��r����r\���� ValueErrorr����r`��r$��)r���ro��r$���cm�l�tokens�suffix�opts��� r���rg��zBaseResolver.read_resolv_conf���s#�����"����a��� B�8<�Q��� ��'�'��*�B� �1����q�6�Q�;�!�A�$�#�+��1������������v�;��?���!�9��,��&�&�v�a�y�1��A�Y�(�*�"%�(�(�"4�"4�V�A�Y�"?�D�K�"$�D�K��A�Y�(�*�"$�D�K�"(���*�����*�*�3�8�8�+=�+=�f�+E�F��#-���A�Y�)�+�%�a�b�z���(�?�*.�D�K� �G�^� �M�M�O�&�#�-�%�/2�3�9�9�S�>�!�3D�/E����%��^�%�-0����3���1B�-C�� �� *�/����N��{��q� �)�*:�;�;��'����a��� B�-��Q�C�.@�A�A� B��J�%/� �#;��%� $�%�� �%/� �#;��%� $�%��K��R�se����G��C3H�+/H�"G0�=H�"H�&H�G-�0H �?H�H �H�H �H�H �H�H#c������������������������ �t���������j������������������j��������������������������}|j�������������������|j������������������|�_��������|j������������������|�_��������|j ������������������|�_��������y#�t��������$�r�t���������w�xY�w)z9Extract resolver configuration from the Windows registry.N)r����� win32util�get_dns_infor]��r$��r��r%���r����)r����infos��� r���rf��zBaseResolver.read_registry��s\������ &��=�=�-�-�/�D��{�{�&�"�k�k���#�/�/�D���+�+�D�K���� &�%�%� &�s����AA �� A0�startrS���c������������������������|�|�j�������������������n|}t��������j��������������������������}||z ��}|�g�}|dk��r|dk��r t��������||���������d}||k\��r t��������||���������t��������||z ��|�j�������������������������S�)Nr���r[���r`���)r_��r����rZ���rF��r\���)r���r���r_��rS���r�����durations��� r����_compute_timeoutzBaseResolver._compute_timeout��s�������%-�$4�4�=�=�(���i�i�k����;���>��F��a�<��"�}�%�h�v�F�F� ����x��!�(�6�B�B��8�h�&����5�5r���r5���c����������������������|�|�j�������������������}g�}|j��������������������������r|j������������������|��������|S�|j������������������t��������j ������������������j�������������������������}|r�t��������|�j�������������������������dkD��r|�j������������������d�d��}nC|�j������������������t��������j ������������������j������������������k7��r|�j�������������������|�j������������������g}ng�}|�j�������������������d}n|�j������������������}|D�]��}|j������������������||z�������������t��������|�������|kD��r|j������������������d|��������|S�|j������������������|��������|S�|j������������������|��������|S�)Nr���r+���)r^���is_absoluter:����concatenater����r����rl��r&���r��r]��r`���insert)r���r5���r��r!��� abs_qname�search_listr`��r}��s��� r���r ��zBaseResolver._get_qnames_to_try7��s-����� ��>��/�/�F�� ������ � ��'�<���9��)�)�#�(�(�-�-�8�I���t�{�{�#�a�'�"&�+�+�a�.�K��[�[�C�H�H�M�M�1�d�k�k�6M��$(�;�;�-�K�"$�K��:�:�%��E� �J�J�E�)�F�!�(�(����8��*��u�:��%��"�(�(��I�6�����"�(�(��3������$�$�Y�/��r���r+��c������������������.�����||�_���������||�_��������||�_��������y)z�Add a TSIG signature to each query. The parameters are passed to ``dns.message.Message.use_tsig()``; see its documentation for details. N)r4��r2��r5��)r���r4��r2��r+��s��� r���r3��zBaseResolver.use_tsig`��s�������������%��r���r���r,��c������������������Z�����|�|du�rd}n|du�rd}||�_���������||�_��������||�_��������||�_��������y)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. NFr[���Tr���)r7��r8��r9��r:��)r���r7��r8��r9��r,��s��� r���r6��zBaseResolver.use_ednsp��s=������0��<�4�5�=��D� �T�\��D��� �"������"��r���c�����������������������||�_���������y)zkOverrides the default flags with your own. *flags*, an ``int``, the message flags to use. N)r;��)r���r;��s��� r���� set_flagszBaseResolver.set_flags���s��������� r���r$���default_portc������������������2����g�}t��������|t���������������r�|D�]���}t��������|t��������j������������������j�������������������������r|}n�t��������j ������������������j ������������������|�������r3|j������������������||�������}t��������j������������������j������������������||�������}n? �t��������|�������j������������������dk7��rt��������� �t��������j������������������j������������������|�������}|j������������������|�����������|S�t��������dt!��������|���������d���������#�t��������$�r�t��������d|��d���������w�xY�w)N�httpsznameserver 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 �))r!���r"���r����r~���rZ���inet� is_addressr9����Do53Nameserverr����schemer����r4���ry��� DoHNameserverr:����type)r����r$��r>��r����enriched_nameserversr~����enriched_nameserverr���s��� r���r<��z BaseResolver._enrich_nameservers���s������ "���k�4�(�)� ��j�#�.�.�*C�*C�D�*4�'��X�X�(�(��4�+�/�/� �L�I�D�*-�.�.�*G�*G�"�D�+�'��#�J�/�6�6�'�A�"5�5��B��+.�.�.�*F�*F�z�*R�'�$�+�+�,?�@�)�*�2�$�#���=�d�;�>O�=P�PQ�R��� ���%���(�)�*���6@��@�����s����C=�=Dc�����������������������|�j�������������������S�r���)r=��rC���s��� r���r$��zBaseResolver.nameservers���s�������� � � r���c������������������`�����|�j������������������||�j������������������|�j��������������������������||�_��������y)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=��)r���r$��s��� r���r$��zBaseResolver.nameservers���s(������� � � ��d�.C�.C�T�Y�Y�O�'��r���)z/etc/resolv.confTr����r����))rF���rG���rH���rI���r����r����r�����__annotations__r���r/���r����r���r����r����r���r���r���r7���Optionr ���r~���rZ��r���r����rg��rf��� ErrorTupler���r ��rm��rn��r3��r�����DEFAULT_EDNS_PAYLOADr6��r���r����r<��rL���r$���setterrR���r���r���r��r�����s{������� �H�H�M�M���3��8�n�$� �I����������� �N��O� �c�]�� �e�C�H�H�M�M�3�.�/� 0�0����� � �s�*�+�+� �I��N��$�s�x�x���/�0�0� �L��J��C�=�����L��C�=���5��c�n�n�&?�&?�!?�@�A�A��EI�0��0�=A�0� �0�*�4E'�#��E'�$��E'�N &��%)�-1� 6��6���5�/�6����j�)�*� 6� � �6�0'��X�X�]�]�'�,4�T�N�'� �c�h�h�m�m� �'�X�8<�/2�x�x�/I�/I� &��&���%���� � �s� 2�3�4�&���������+�,� &� � �&�$�,-���{�{�7�7�37�#��u�S�$�Y�'�(�#���#��� #� ��$�s�x�x���/�0�#�� � #�B�s���t�����!$��e�C����)B�)B�$B�C�D�!$���s�C�x�.�!$��� !$� � �c�n�n�'�'� (�!$���!$�F��!� �%��S�^�^�6�6�6�7� 8�!���!� ����(�#�E�#�s�~�~�/H�/H�*H�$I�J�(� �(���(r���r��c��������������������n����e�Zd�ZdZej ������������������j������������������ej������������������j������������������ddddddfde ej������������������j������������������ef���de ej ������������������j������������������ef���de ej������������������j������������������ef���d ed ee���deded ee���dee���defd�Zej ������������������j������������������ej������������������j������������������dddddfde ej������������������j������������������ef���de ej ������������������j������������������ef���de ej������������������j������������������ef���d ed ee���deded ee���defd�Zdedededefd�Zej2������������������fde ej������������������j������������������ef���dededefd�Zde ej������������������j������������������ef���dej������������������j������������������fd�Zdd eddfd�Zy)�Resolverr���FNTr���r5���r|���r}���r���sourcer���source_portr_��r��r)���c ����������� ������������t��������|�|||||| �������} t��������j��������������������������} �| j��������������������������\��}} | �| S�|�J��d}|s{| j��������������������������\��}}}|rt��������j������������������|��������|�j������������������||| j�������������������������} �|j������������������|||||��������}| j������������������|d�������\��} }| �| S�|s�{��#�t��������$�r}| j������������������d|�������\��}}Y�d}~��d}~ww�xY�w)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)r\���r���r���r��) r��r����rB��rG���sleepr���rS���ri���r4���rY��)r���r5���r|���r}���r��r���r��r���r_��r��� resolutionr���rn���r�����doner~���r(��r\���r6���rH���_s��� r����resolvezResolver.resolve���s$�����~�!��%���#�/A�6� � ��� � ���� *� 7� 7� 9��W�f� ��!�� ��&�&�&��D��-7�-G�-G�-I�*��S�'���J�J�w�'��/�/��x��AR�AR�S�� �)�/�/�� '�%�$/�!$�� 0�� �H��",�!8�!8��4�!H���� ��%�!�M�-�����0�!��� *� 7� 7��b� A�I�Q�����s����C�� C*�C%�%C*c ������������������l�����t��������j������������������dt��������d���������|�j������������������||||||||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() insteadrD���� stacklevelT��warnings�warn�DeprecationWarningr���) r���r5���r|���r}���r��r���r��r���r_��s ��� r���ri���zResolver.query<��sG������$� � � �@��� � ��|�|���������� �� r����ipaddrr���r���c����������������������i�}|j������������������|��������t��������j������������������j������������������|d<���t��������j������������������j ������������������|d<����|�j������������������t��������j������������������j������������������|�������g|��i�|��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. r|���r}���) �updater����r�����PTRr����rS��r����reversename�from_address)r���r���r���r����modified_kwargss��� r����resolve_addresszResolver.resolve_address_��st������ �+-�����v�&�$'�M�M�$5�$5���!�%(�^�^�%6�%6�� �"��t�|�|��O�O�(�(��0� �37� �;J� �� r���r����r����c����������������������i�}|j������������������|��������|j������������������dd��������t��������j������������������j������������������|d<���|t ��������j������������������k(��rB�|�j������������������|t��������j������������������j������������������fi�|��}t��������j������������������|��������S�|t ��������j������������������k(��rB�|�j������������������|t��������j������������������j������������������fi�|��}t��������j������������������|��������S�|t ��������j������������������k7��rt��������d|�����������|j������������������dd�������}|j������������������d d�������}t!��������j ��������������������������} �|�j������������������|t��������j������������������j������������������fd |�j#������������������| |�������d�|��}|j$������������������}�|�j������������������|t��������j������������������j������������������fd |�j#������������������| |�������d�|��}t��������j������������������|||���������} | st'��������|j(������������������� ��������| S�)a��Use 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. r|���Nr}���)r����)r����r����r��Tr_��F)r��r_��)r����r����r����r*��)r���r-��r����r����rS��r����r����r���r����r����r����r����r����r����r����r����r����r���r5���rf���r6���)r���r����r����r���r���r����r����r��r_��r���r����s��� r����resolve_namezResolver.resolve_namew��s������.�+-�����v�&����H�d�+�%(�^�^�%6�%6�� �"��V�^�^�#�����d�C�M�M�O�O�G��G�B��#�#�r�#�*�*� �v��� &�����d�C�M�M�$6�$6�J�/�J�B��#�#�r�#�*�*� �v�'�'� '�%�(?��x�&H�I�I�,�0�0�1E�t�L��"�&�&�z�4�8��� � ��� �T�\�\���M�M��� �� %��*�*�5�(�;� � �� ����x�x�� �T�\�\���M�M�O�O� �� %��*�*�5�(�;� � �� ����"�"�b�R�?Q�;Q�"�R����B�K�K�0�0��r���c����������������������� �|�j������������������|d��������}|j������������������}|S�#�t��������j������������������j������������������$�r}|j������������������}Y�d}~|S�d}~ww�xY�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)r���r3���r����r��r���)r���r����r����r3���rW��s��� r���r3���zResolver.canonical_name���sY������ .��\�\�$�5�\�A�F�#�2�2�N�������|�|�$�$�� .��-�-�N���� .�s����#��A��A�Ac������������������T���� �t��������j���������������������������|z���}|�j������������������t��������j������������������j������������������d|��������}t��������j ������������������j ������������������|�������}t��������j������������������j������������������||�������}t��������|�������dkD��r||�_ ��������yy#�t��������$�r�Y�yw�xY�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_��r���N)r����r���r�����_ddr�_local_resolver_nameri���� _remaining�_get_nameservers_syncr&���r$��r4���)r���r_��r����r����r\���r$��s��� r����try_ddrzResolver.try_ddr���s�������& �����x�/�J��\�\����-�-�v���"���F���i�i�*�*�:�6�G��(�(�8�8���I�K��;��!�#�#.�� ��$���� �� �s����BB�� B'�&B'�rj��)rF���rG���rH���rI���r����r����r����r����rS��r���r����r����r/���r����r����r����r���r����r����r{���r���ri���r���r���r����r����r����r���r3���r���rR���r���r���r���r������s]������ �7:�m�m�o�o�9<���9J�9J�� $�#'��$(�!%�d"��S�X�X�]�]�C�'�(�d"���c�m�m�-�-�s�2�3�d"���s�~�~�0�0�#�5�6� d"� ��d"���� � d"��!�d"���d"���5�/�d"�����d"�� �d"�R�7:�m�m�o�o�9<���9J�9J�� $�#'��$(�! ��S�X�X�]�]�C�'�(�! ���c�m�m�-�-�s�2�3�! ���s�~�~�0�0�#�5�6� ! � ��! ���� � ! ��!�! ���! ���5�/�! �� �! �F �c�� �#�� ��� ��� �6��&�&�?��C�H�H�M�M�3�&�'�?���?��� ?� � �?�F�5�������);�#<����������.������r���r����default_resolverc�������������������>�����t���������� t�����������������t����������J��t���������S�)z7Get the default resolver, initializing it if necessary.)r����reset_default_resolverrR���r���r����get_default_resolverr������s ��������� ��'�'�'��r���c������������������������t����������������ay)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���r���rR���r���r���r���r������s������� �z�r���FTr5���r|���r}���r��r���r��r���r_��r��c ������������������D�����t����������������j������������������|�||||||||� ������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. )r���r���) r5���r|���r}���r��r���r��r���r_��r��s ��� r���r���r�����s5������(� �!�)�)� ��������� �� r���c������������������`�����t��������j������������������dt��������d���������t��������|�|||||||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. z)please use dns.resolver.resolve() insteadrD��r���Tr���)r5���r|���r}���r��r���r��r���r_��s��� r���ri���ri���)��sC������"� �M�M�3�5G�TU���� ��������� �� r���r���r���r���c������������������>������t����������������j������������������|�g|��i�|��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. )r���r���)r���r���r���s��� r���r���r���J��s%�������2��!�1�1�&�J�4�J�6�J�Jr���r����r����c������������������:������t����������������j������������������|�|fi�|��S�)z�Use a resolver to query for address records. See ``dns.resolver.Resolver.resolve_name`` for more information on the parameters. )r���r���)r����r����r���s��� r���r���r���T��s"�������/��!�.�.�t�V�F�v�F�Fr���c������������������4�����t����������������j������������������|��������S�)z�Determine the canonical name of *name*. See ``dns.resolver.Resolver.canonical_name`` for more information on the parameters and possible exceptions. )r���r3����r����s��� r���r3���r3���`��s������� �!�0�0��6�6r���c������������������4�����t����������������j������������������|��������S�)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. )r���r���r���s��� r���r���r���j��s������� �!�)�)�(�3�3r���r��c�����������������������t��������|�t���������������r8t��������j������������������j ������������������|�t��������j������������������j �������������������������}�|� t ����������������}|�j��������������������������st��������|���������t��������j��������������������������}|�||z���}nd} � �|�|t��������j��������������������������z ��}|dk��rd}nd}|j������������������|�t��������j������������������j������������������|||��������}|j�������������������J��|j������������������j������������������|�k(��r|�S� � �|�j3��������������������������}���#�t��������j������������������j������������������t��������j������������������j ������������������f$�r�} t��������| t��������j������������������j�������������������������r | j#��������������������������j%������������������|��������} n| j'��������������������������} | r�| j(������������������D�]���}|j*������������������t��������j������������������j������������������k(��s�+|j,������������������|k(��s�;|j������������������j/������������������|��������\��}} } |t��������j������������������j0������������������k(��s�x|j������������������c�cY�d} ~ S��Y�d} ~ ��=d} ~ ww�xY�w#�t��������j������������������j4������������������$�r�t6���������w�xY�w)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``. Nr���r���)r!���r/���r����r����r��rl��r���r���rr���r����r���r�����SOAr����r��r���rf���r���r9���r6���� authorityr|���r}����fullcompare�NAMERELN_SUPERDOMAIN�parent�NoParentru���)r����r}���r��r��r_��r���r����� rlifetimer����rW��r6����rrs�nrr���s��� r���� zone_for_namer���t��s������@��$����x�x�!�!�$���� � �6����'�)�������$����I�I�K�E����X�%� �� � � ,��%�&�����4� ���>� !�I� � ��%�%��c�m�m�'�'��#� ��&���F���<�<�+�+�+��|�|� � �D�(����)�, ��;�;�=�D�I��� ����%�%�s�|�|�'<�'<�=�� ,��!�S�\�\�2�2�3��;�;�=�,�,�T�2���:�:�<���#�-�-�C��z�z�S�]�]�%6�%6�6�3�;�;�'�;Q�%(�X�X�%9�%9�$�%?� ��Q������!>�!>�>��$'�8�8�O��.��� ,��*��x�x� � �� ��O� �sD����A9D��I��7I �BI�!I�1<I�. I�;I �I�I �$I4ri���wherer���c�����������������������|� t����������������}g�}t��������|�t���������������rOt��������j������������������j������������������|��������r0|j ������������������t��������j������������������j������������������|�|���������������nT|j������������������|�|�������j��������������������������D�]1��}|j ������������������t��������j������������������j������������������||����������������3�t��������j������������������j������������������d��������}||_ ��������|S�)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.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. F)rb��)r���r!���r/���r����r���r���r:���r~���r���r���r����r��r���r$��)r���r���r����r��r$��r�����ress��� r����make_resolver_atr������s�������.���'�)��?A�K��%���#�(�(�"5�"5�e�"<����3�>�>�8�8���E�F��,�,�U�F�;�E�E�G�G����s�~�~�<�<�W�d�K�L��H� �,�,� � �%� � 0�C�!�C�O��Jr���c ������������������L�����t��������|�| ||�������j������������������||||||||| � ������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. )r���r���) r���r5���r|���r}���r��r���r��r���r_��r��r���r����r��s ��� r���� resolve_atr������s=������8��E�4���:�B�B� ��������� �� r���c����������� �����������|t���������j������������������z��dk7��rt��������|�|||||�������S�|t���������j������������������t���������j������������������z��z��dk7��r$t��������j ������������������t���������j������������������d��������|��&|�$t��������j ������������������t���������j������������������d��������g�}d�}|��t��������|�|||||�������S� �t��������j������������������j������������������|���������t��������|�|||||�������S�#�t��������$�r�Y�nw�xY�w �t��������j������������������|�|�������}|j��������������������������}|j��������������������������j!������������������d�������}nq#�t��������j"������������������j$������������������$�r%�t��������j ������������������t���������j������������������d��������t��������$�r%�t��������j ������������������t���������j&������������������d��������w�xY�wd�} �|�d} nt)��������|�������} nK#�t��������$�r?�|t���������j*������������������z��dk(��r& �t��������j,������������������|�������} n#�t��������$�r�Y�nw�xY�wY�nw�xY�w| �$t��������j ������������������t���������j������������������d��������g�} |dk(��r!t���������j.������������������t���������j0������������������g}n|g}|t���������j2������������������z��dk7��r|}nd}|D�]R��\��} }|D�]H��}t4��������|���D�]:��}t��������j������������������j7������������������| | f|�������}| j9������������������|||||f���������<��J��T�t;��������| �������dk(��r$t��������j ������������������t���������j������������������d��������| S�)Nr���z*Non-recoverable failure in name resolution�Name or service not knownTz$Temporary failure in name resolution��)r�����AI_NUMERICHOST�_original_getaddrinfo� AI_ADDRCONFIG�AI_V4MAPPED�gaierror�EAI_FAIL� EAI_NONAMEr����r����af_for_addressr4���� _resolverr���r����r3���rV��r��r���� EAI_AGAINr�����AI_NUMERICSERV� getservbyname� SOCK_DGRAM�SOCK_STREAM�AI_CANONNAME�_protocols_for_socktype�low_level_address_tupler:���r&���)�host�servicer�����socktype�protor;���addrsr3���r����r����tuples� socktypesr7����addr�af� addr_tuples��� r����_getaddrinfor��)��s������� �v�$�$�$��)��%�T�7�F�H�e�U�S�S���$�$�v�'9�'9�9�:�a�?���o�o��O�O�I� �� ���|����o�o�f�/�/�1L�M�M��E��N���|�$�T�7�F�H�e�U�S�S� �� ������%�$�T�7�F�H�e�U�S�S���� �� �� X��(�(��v�6���.�.�0�� �/�/�1�9�9�$�?����<�<� � ��N��o�o�f�/�/�1L�M�M���X���o�o�f�.�.�0V�W�W� X�� ��D���?��D��w�<�D������6�(�(�(�A�-� ��+�+�G�4����� �� �� ����|��o�o�f�/�/�1L�M�M� �F��1�}��&�&��(:�(:�;� ��J� ��v�"�"�"�a�'��������b�!�H�0��:�� �X�X�=�=�t�T�l�B�O� �� � �r�8�U�E�:�F�G��;��"��� ��6�{�a���o�o�f�/�/�1L�M�M��MsV����1.C �� C,�+C,�0AD6��6A.F$�*F;��;H�G1�0H�1 G=�:H�<G=�=H�Hc�����������������������|�d���}|�d���}t��������|��������dk(��r|�d���}t��������j������������������}nd�}t��������j������������������}t ��������|||t��������j ������������������t��������j������������������d�������}t��������|�������dkD��rt��������d��������|d���d���d���}|t��������j������������������z��rd}nd}t��������j������������������j������������������|�������} |t��������j������������������z��dk(��r@ �t��������j������������������| d�������} | j������������������d���j ������������������j#������������������d �������}n|}|�|dt1��������|�������z���z ��}|t��������j2������������������z��rt1��������|�������}||fS�t��������j4������������������||�������}||fS�#�t��������j$������������������j&������������������t��������j$������������������j(������������������f$�rO�|t��������j*������������������z��r$t��������j,������������������t��������j.������������������d ��������|}|�|dt1��������|�������z���z ��}Y���w�xY�w)Nr���r+�������rU���z'sockaddr resolved to multiple addresses�udpr��r���Tr����%)r&���r����r����r����r��r����SOL_TCPrN���NI_DGRAMr����r���r����NI_NUMERICHOSTr���r���r�����targetrV��r��r���rf����NI_NAMEREQDr���r���r/����NI_NUMERICSERV� getservbyport) �sockaddrr;��r���r����scoper����r���r���pnamer5���r�����hostnamer���s ��� r����_getnameinfor��}��s�������A�;�D��A�;�D� �8�}����������������� �$��f�f�.@�.@�&�.�.�RS� T�F� �6�{�Q���?�@�@��!�9�Q�<��?�D��v���������O�O�(�(��.�E��v�$�$�$��)� -��&�&�u�e�4�F��|�|�A��-�-�5�5�d�;�H��������c�%�j�(�(�H��v�$�$�$��d�)��� �g�����&�&�t�U�3���g��������%�%�s�|�|�'<�'<�=�� -��v�)�)�)��o�o�f�&7�&7�9T�U�U��H�� ��C�#�e�*�,�,��� -�s����>E/��/BG5�4G5c������������������r�����|��t��������j��������������������������}� �t��������|��������\��}�}}|�S�#�t��������$�r�Y�|�S�w�xY�wr���)r����rk���_gethostbyaddrr4���)r����r���s��� r����_getfqdnr�����sJ�������|��!�!�#�� �%�d�+���q�!� ��K����� ���K� �s����)�� 6�6c������������������$�����t��������|��������d���d���S�)NrD��r���)�_gethostbyname_exr���s��� r����_gethostbynamer�����s�������T�"�1�%�a�(�(r���c������������������������g�}g�}t��������|�dt��������j������������������t��������j������������������t��������j������������������t��������j �������������������������}|d���d���}|D�]��}|j ������������������|d���d�������������|||fS�)Nr���rU���r��)r��r����r����r���r ��r���r:���)r�����aliasesr����r���� canonical�items��� r���r��r�����su�������G��I� ��a�����!3�!3�V�^�^�V�EX�EX��F���q� �!��I�������a����$���� �w� �*�*r���c���������������������� �t���������j������������������j������������������|���������|�dddf}t��������j������������������}t��������|t��������j�������������������������\��}}g�}g�}t��������|d|t��������j������������������t��������j������������������t��������j�������������������������}|d���d���}t���������j ������������������j#������������������||��������} |D�]A��} | d���d���}t���������j ������������������j#������������������||�������}| |k(��s�1|j%������������������|���������C�|||fS�#�t ��������$�rj� �t���������j������������������j������������������|���������n1#�t ��������$�r%�t��������j������������������t��������j������������������d��������w�xY�w|�df}t��������j������������������}Y���@w�xY�w)N�P���r���r���rU���r��)r�����ipv6� inet_atonr����r����r4����ipv4r���r���r����r��r ��r��r���r ��r���r���� inet_ptonr:���) �ipr��r����r����r���r��r����r���r���bin_ipr��r���bin_addrs ��� r���r��r�����sU����� ������2����A�q�>��������X�v�'9�'9�:�I�T�1��G��I� ��a���+�+�V�^�^�V�=P�=P��F���q� �!��I���X�X� � ��� +�F����A�w�q�z���8�8�%�%�f�d�3���X�����T�"� ��� �w� �*�*��1��� � R��H�H���r�"���� R��/�/�&�"3�"3�5P�Q�Q� R����8������ �s)����5D�� E8�D/�.E8�/.E�E8�7E8c������������������������|�� t����������������}�|�at��������t��������_��������t ��������t��������_��������t��������t��������_��������t��������t��������_ ��������t��������t��������_��������t��������t��������_��������y)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)r���r���r��r�����getaddrinfor���getnameinfor���getfqdnr��� gethostbynamer���gethostbyname_exr��� gethostbyaddr)r��s��� r����override_system_resolverr/�����sF���������'�)���I�%�F��%�F���F�N�)�F��/�F��)�F�r���c������������������������da�t��������t��������_��������t��������t��������_��������t��������t��������_��������t��������t��������_ ��������t��������t��������_��������t��������t��������_ ��������y)z5Undo the effects of prior override_system_resolver().N)r���r���r����r)���_original_getnameinfor*���_original_getfqdnr+���_original_gethostbynamer,���_original_gethostbyname_exr-���_original_gethostbyaddrr.��rR���r���r����restore_system_resolverr6�����s8��������I�.�F��.�F��&�F�N�2�F��8�F��2�F�r���r����r���)r���r���)zrI���rv��r@��r����rd��r����r����r����typingr���r���r���r���r���r ���r ���r����urllib.parser����dns._ddrr�����dns.edns� dns.exception� dns.flags�dns.inet�dns.ipv4�dns.ipv6�dns.message�dns.name� dns.rdata�dns.nameserver� dns.query� dns.rcode�dns.rdataclass� dns.rdatatype�dns.rdtypes.svcbbase�dns.reversename�dns.tsigre��� dns.win32utilrK���DNSExceptionr���rP���r/���r����r����r4���r����r[��r���rX����TimeoutrZ���rf���rm���rr���ru���rw���ry���r{���r'���r����r����r����r����r����r����r����r����r����r����r����r����r����r��r��r��r���r���r���r���r���r����rS��r����r���ri���r���r����r���r3���r���r���r���r���r����SOL_UDPr���r ��r���r���r)��r���r*��r1��r+��r2��r,��r3��r-��r4��r.��r5��r��r��r��r��r��r��r/��r6��rR���r���r����<module>rO�����s�����$����� �� �� ��������N��N��N��!��������������������������������������<�<�7���U/�s�}�}�)�)��U/�pC�s�}�}�)�)��C����S�M��� �)�S�.���S�[�[� � �!� #�� ��D��,����c���� �c�m�m�+�+�� �,���'�s�}�}�)�)��'�$ �C�M�M�.�.�� �2P�#�-�-�,�,��P�M�� � �*�*��M�+�C�M�M�.�.��+�P�c�m�m�8�8��P�B��B�J@�d��@�.%�'��.%�b7��7�+��+�>�������� � � 7� 7����9R�9R�R�S��LJ�I��LJ�^#��#�*l�y��l�^K!��K!�\N(��N(�b [�|��[�~�(,���(�8�$��+��h���"��36�-�-�/�/�58�^�^�5F�5F�� �#�� $�!���������#�$���#�-�-�)�)�3�.�/����3�>�>�,�,�c�1� 2��� � � � �S�M���� ������u�o��� �T�N�����F�36�-�-�/�/�58�^�^�5F�5F�� �#�� $���������#�$���#�-�-�)�)�3�.�/����3�>�>�,�,�c�1� 2��� � � � �S�M���� ������u�o�����BK�C��K���K�s��K�v��K��4:�3C�3C� G� ���� � �s�"� #� G�-0� G�OR� G�� G�7��s�x�x�}�}�c�1�2��7�s�x�x�}�}��7�4�e��4�d��4��*-���):�):��#'� $�R� ���� � �s�"� #�R� �^�^� &� &�R�� �R���x� � R� ��u�o�R�� �X�X�]�]� R�n���"�"�#'� !��������#�$�!� �!�� �!���x� � !� ��!�N�36�-�-�/�/�58�^�^�5F�5F�� �#�� $�!���"�"�#'�&��������#�$�&��������#�$�&�� �#�-�-�)�)�3�.�/�&���3�>�>�,�,�c�1� 2� &� � �&�� �S�M� &���&���&���u�o�&�� �T�N�&���&�� �&���x� �&���&�^�������'� ������(���� � � ��*�*����*�*����N�N��� �.�.���#�4�4��� �.�.���� �t�F�$4�$4�q��QR�Q�h$�N �)� +�+�@*�x��'9��*�T��*�4 3r���