Skip to content

# Base

The tool to check the availability or syntax of domain, IP or URL.

::

    ██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
    ██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
    ██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
    ██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
    ██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
    ╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝

Provides the base of all availability checker classes.

Author: Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom

Special thanks: https://pyfunceble.github.io/#/special-thanks

Contributors: https://pyfunceble.github.io/#/contributors

Project link: https://github.com/funilrys/PyFunceble

Project documentation: https://docs.pyfunceble.com

Project homepage: https://pyfunceble.github.io/

License: ::

    Copyright 2017, 2018, 2019, 2020, 2022, 2023, 2024, 2025 Nissar Chababy

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        https://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

## `AvailabilityCheckerBase`

Bases: `CheckerBase`

Provides the base of all our availability checker classes.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`subject` | `str` | Optional, The subject to work with. | `None`
`use_extra_rules` | `bool` | Optional, Activates/Disables the usage of our own set of extra rules. | `None`
`use_whois_lookup` | `bool` | Optional, Activates/Disables the usage of the WHOIS lookup to gather the status of the given :code:`subject`. | `None`
`use_dns_lookup` | `bool` | Optional, Activates/Disables the usage of the DNS lookup to gather the status of the given :code:`subject`. | `None`
`use_netinfo_lookup` | `bool` | Optional, Activates/Disables the usage of the network information lookup module to gather the status of the given :code:`subject`. | `None`
`use_http_code_lookup` | `bool` | Optional, Activates/Disables the usage of the HTTP status code lookup to gather the status of the given :code:`subject`. | `None`
`use_reputation_lookup` | `bool` | Optional, Activates/Disables the usage of the reputation dataset lookup to gather the status of the given :code:`subject`. | `None`
`do_syntax_check_first` | `bool` | Optional, Activates/Disables the check of the status before the actual status gathering. | `None`
`use_whois_db` | `bool` | Optional, Activates/Disable the usage of a local database to store the WHOIS datasets. | `None`

Source code in `PyFunceble/checker/availability/base.py`

      86
      87
      88
      89
      90
      91
      92
      93
      94
      95
      96
      97
      98
      99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
     282
     283
     284
     285
     286
     287
     288
     289
     290
     291
     292
     293
     294
     295
     296
     297
     298
     299
     300
     301
     302
     303
     304
     305
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
     317
     318
     319
     320
     321
     322
     323
     324
     325
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
     336
     337
     338
     339
     340
     341
     342
     343
     344
     345
     346
     347
     348
     349
     350
     351
     352
     353
     354
     355
     356
     357
     358
     359
     360
     361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
     374
     375
     376
     377
     378
     379
     380
     381
     382
     383
     384
     385
     386
     387
     388
     389
     390
     391
     392
     393
     394
     395
     396
     397
     398
     399
     400
     401
     402
     403
     404
     405
     406
     407
     408
     409
     410
     411
     412
     413
     414
     415
     416
     417
     418
     419
     420
     421
     422
     423
     424
     425
     426
     427
     428
     429
     430
     431
     432
     433
     434
     435
     436
     437
     438
     439
     440
     441
     442
     443
     444
     445
     446
     447
     448
     449
     450
     451
     452
     453
     454
     455
     456
     457
     458
     459
     460
     461
     462
     463
     464
     465
     466
     467
     468
     469
     470
     471
     472
     473
     474
     475
     476
     477
     478
     479
     480
     481
     482
     483
     484
     485
     486
     487
     488
     489
     490
     491
     492
     493
     494
     495
     496
     497
     498
     499
     500
     501
     502
     503
     504
     505
     506
     507
     508
     509
     510
     511
     512
     513
     514
     515
     516
     517
     518
     519
     520
     521
     522
     523
     524
     525
     526
     527
     528
     529
     530
     531
     532
     533
     534
     535
     536
     537
     538
     539
     540
     541
     542
     543
     544
     545
     546
     547
     548
     549
     550
     551
     552
     553
     554
     555
     556
     557
     558
     559
     560
     561
     562
     563
     564
     565
     566
     567
     568
     569
     570
     571
     572
     573
     574
     575
     576
     577
     578
     579
     580
     581
     582
     583
     584
     585
     586
     587
     588
     589
     590
     591
     592
     593
     594
     595
     596
     597
     598
     599
     600
     601
     602
     603
     604
     605
     606
     607
     608
     609
     610
     611
     612
     613
     614
     615
     616
     617
     618
     619
     620
     621
     622
     623
     624
     625
     626
     627
     628
     629
     630
     631
     632
     633
     634
     635
     636
     637
     638
     639
     640
     641
     642
     643
     644
     645
     646
     647
     648
     649
     650
     651
     652
     653
     654
     655
     656
     657
     658
     659
     660
     661
     662
     663
     664
     665
     666
     667
     668
     669
     670
     671
     672
     673
     674
     675
     676
     677
     678
     679
     680
     681
     682
     683
     684
     685
     686
     687
     688
     689
     690
     691
     692
     693
     694
     695
     696
     697
     698
     699
     700
     701
     702
     703
     704
     705
     706
     707
     708
     709
     710
     711
     712
     713
     714
     715
     716
     717
     718
     719
     720
     721
     722
     723
     724
     725
     726
     727
     728
     729
     730
     731
     732
     733
     734
     735
     736
     737
     738
     739
     740
     741
     742
     743
     744
     745
     746
     747
     748
     749
     750
     751
     752
     753
     754
     755
     756
     757
     758
     759
     760
     761
     762
     763
     764
     765
     766
     767
     768
     769
     770
     771
     772
     773
     774
     775
     776
     777
     778
     779
     780
     781
     782
     783
     784
     785
     786
     787
     788
     789
     790
     791
     792
     793
     794
     795
     796
     797
     798
     799
     800
     801
     802
     803
     804
     805
     806
     807
     808
     809
     810
     811
     812
     813
     814
     815
     816
     817
     818
     819
     820
     821
     822
     823
     824
     825
     826
     827
     828
     829
     830
     831
     832
     833
     834
     835
     836
     837
     838
     839
     840
     841
     842
     843
     844
     845
     846
     847
     848
     849
     850
     851
     852
     853
     854
     855
     856
     857
     858
     859
     860
     861
     862
     863
     864
     865
     866
     867
     868
     869
     870
     871
     872
     873
     874
     875
     876
     877
     878
     879
     880
     881
     882
     883
     884
     885
     886
     887
     888
     889
     890
     891
     892
     893
     894
     895
     896
     897
     898
     899
     900
     901
     902
     903
     904
     905
     906
     907
     908
     909
     910
     911
     912
     913
     914
     915
     916
     917
     918
     919
     920
     921
     922
     923
     924
     925
     926
     927
     928
     929
     930
     931
     932
     933
     934
     935
     936
     937
     938
     939
     940
     941
     942
     943
     944
     945
     946
     947
     948
     949
     950
     951
     952
     953
     954
     955
     956
     957
     958
     959
     960
     961
     962
     963
     964
     965
     966
     967
     968
     969
     970
     971
     972
     973
     974
     975
     976
     977
     978
     979
     980
     981
     982
     983
     984
     985
     986
     987
     988
     989
     990
     991
     992
     993
     994
     995
     996
     997
     998
     999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    1024
    1025
    1026
    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    1101
    1102
    1103
    1104
    1105
    1106
    1107
    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117

    class AvailabilityCheckerBase(CheckerBase):
        """
        Provides the base of all our availability checker classes.

        :param str subject:
            Optional, The subject to work with.
        :param bool use_extra_rules:
            Optional, Activates/Disables the usage of our own set of extra rules.
        :param bool use_whois_lookup:
            Optional, Activates/Disables the usage of the WHOIS lookup to gather
            the status of the given :code:`subject`.
        :param bool use_dns_lookup:
            Optional, Activates/Disables the usage of the DNS lookup to gather the
            status of the given :code:`subject`.
        :param bool use_netinfo_lookup:
            Optional, Activates/Disables the usage of the network information
            lookup module to gather the status of the given :code:`subject`.
        :param bool use_http_code_lookup:
            Optional, Activates/Disables the usage of the HTTP status code lookup
            to gather the status of the given :code:`subject`.
        :param bool use_reputation_lookup:
            Optional, Activates/Disables the usage of the reputation dataset
            lookup to gather the status of the given :code:`subject`.
        :param bool do_syntax_check_first:
            Optional, Activates/Disables the check of the status before the actual
            status gathering.
        :param bool use_whois_db:
            Optional, Activates/Disable the usage of a local database to store the
            WHOIS datasets.
        """

        # pylint: disable=too-many-public-methods, too-many-instance-attributes

        STD_USE_EXTRA_RULES: bool = True
        STD_USE_WHOIS_LOOKUP: bool = True
        STD_USE_DNS_LOOKUP: bool = True
        STD_USE_NETINFO_LOOKUP: bool = True
        STD_USE_HTTP_CODE_LOOKUP: bool = True
        STD_USE_REPUTATION_LOOKUP: bool = False
        STD_USE_WHOIS_DB: bool = True

        dns_query_tool: Optional[DNSQueryTool] = None
        whois_query_tool: Optional[WhoisQueryTool] = None
        addressinfo_query_tool: Optional[AddressInfo] = None
        hostbyaddr_query_tool: Optional[HostByAddrInfo] = None
        http_status_code_query_tool: Optional[HTTPStatusCode] = None
        domain_syntax_checker: Optional[DomainSyntaxChecker] = None
        ip_syntax_checker: Optional[IPSyntaxChecker] = None
        url_syntax_checker: Optional[URLSyntaxChecker] = None
        extra_rules_handlers: Optional[List[ExtraRuleHandlerBase]] = None
        url2netloc: Optional[Url2Netloc] = None

        _use_extra_rules: bool = False
        _use_whois_lookup: bool = False
        _use_dns_lookup: bool = False
        _use_netinfo_lookup: bool = False
        _use_http_code_lookup: bool = False
        _use_reputation_lookup: bool = False
        _use_whois_db: bool = False

        status: Optional[AvailabilityCheckerStatus] = None
        params: Optional[AvailabilityCheckerParams] = None

        def __init__(
            self,
            subject: Optional[str] = None,
            *,
            use_extra_rules: Optional[bool] = None,
            use_whois_lookup: Optional[bool] = None,
            use_dns_lookup: Optional[bool] = None,
            use_netinfo_lookup: Optional[bool] = None,
            use_http_code_lookup: Optional[bool] = None,
            use_reputation_lookup: Optional[bool] = None,
            do_syntax_check_first: Optional[bool] = None,
            db_session: Optional[Session] = None,
            use_whois_db: Optional[bool] = None,
            use_platform: Optional[bool] = None,
        ) -> None:
            self.dns_query_tool = DNSQueryTool()
            self.whois_query_tool = WhoisQueryTool()
            self.addressinfo_query_tool = AddressInfo()
            self.hostbyaddr_query_tool = HostByAddrInfo()
            self.http_status_code_query_tool = HTTPStatusCode()
            self.domain_syntax_checker = DomainSyntaxChecker()
            self.ip_syntax_checker = IPSyntaxChecker()
            self.url_syntax_checker = URLSyntaxChecker()
            # WARNING: Put the aggressive one first!
            self.extra_rules_handlers = [
                SubjectSwitchRulesHandler(),
                DNSRulesHandler(),
                EToxicHandler(),
                ExtraRulesHandler(),
                ExternalRulesHandler(rulesets=PyFunceble.storage.SPECIAL_RULES),
            ]
            self.db_session = db_session

            self.params = AvailabilityCheckerParams()

            self.status = AvailabilityCheckerStatus()
            self.status.params = self.params
            self.status.dns_lookup_record = self.dns_query_tool.lookup_record
            self.status.whois_lookup_record = self.whois_query_tool.lookup_record

            if use_extra_rules is not None:
                self.use_extra_rules = use_extra_rules
            else:
                self.guess_and_set_use_extra_rules()

            if use_whois_lookup is not None:
                self.use_whois_lookup = use_whois_lookup
            else:
                self.guess_and_set_use_whois_lookup()

            if use_dns_lookup is not None:
                self.use_dns_lookup = use_dns_lookup
            else:
                self.guess_and_set_dns_lookup()

            if use_netinfo_lookup is not None:
                self.use_netinfo_lookup = use_netinfo_lookup
            else:
                self.guess_and_set_use_netinfo_lookup()

            if use_http_code_lookup is not None:
                self.use_http_code_lookup = use_http_code_lookup
            else:
                self.guess_and_set_use_http_code_lookup()

            if use_reputation_lookup is not None:
                self.use_reputation_lookup = use_reputation_lookup
            else:
                self.guess_and_set_use_reputation_lookup()

            if use_whois_db is not None:
                self.use_whois_db = use_whois_db
            else:
                self.guess_and_set_use_whois_db()

            super().__init__(
                subject,
                do_syntax_check_first=do_syntax_check_first,
                db_session=db_session,
                use_platform=use_platform,
            )

        @property
        def use_extra_rules(self) -> bool:
            """
            Provides the current value of the :code:`_use_extra_rules` attribute.
            """

            return self._use_extra_rules

        @use_extra_rules.setter
        def use_extra_rules(self, value: bool) -> None:
            """
            Sets the value which authorizes the usage of the special rule.

            :param value:
                The value to set.

            :raise TypeError:
                When the given :code:`value` is not a :py:class:`bool`.
            """

            if not isinstance(value, bool):
                raise TypeError(f"<value> should be {bool}, {type(value)} given.")

            self._use_extra_rules = self.params.use_extra_rules = value

        def set_use_extra_rules(self, value: bool) -> "AvailabilityCheckerBase":
            """
            Sets the value which authorizes the usage of the special rule.

            :param value:
                The value to set.
            """

            self.use_extra_rules = value

            return self

        @property
        def use_whois_lookup(self) -> bool:
            """
            Provides the current value of the :code:`_use_whois_lookup` attribute.
            """

            return self._use_whois_lookup

        @use_whois_lookup.setter
        def use_whois_lookup(self, value: bool) -> None:
            """
            Sets the value which authorizes the usage of the WHOIS lookup.

            :param value:
                The value to set.

            :raise TypeError:
                When the given :code:`value` is not a :py:class:`bool`.
            """

            if not isinstance(value, bool):
                raise TypeError(f"<value> should be {bool}, {type(value)} given.")

            self._use_whois_lookup = self.params.use_whois_lookup = value

        def set_use_whois_lookup(self, value: bool) -> "AvailabilityCheckerBase":
            """
            Sets the value which authorizes the usage of the WHOIS lookup.

            :param value:
                The value to set.
            """

            self.use_whois_lookup = value

            return self

        @property
        def use_dns_lookup(self) -> bool:
            """
            Provides the current value of the :code:`_use_dns_lookup` attribute.
            """

            return self._use_dns_lookup

        @use_dns_lookup.setter
        def use_dns_lookup(self, value: bool) -> None:
            """
            Sets the value which authorizes the usage of the DNS Lookup.

            :param value:
                The value to set.

            :raise TypeError:
                When the given :code:`value` is not a :py:class:`bool`.
            """

            if not isinstance(value, bool):
                raise TypeError(f"<value> should be {bool}, {type(value)} given.")

            self._use_dns_lookup = self.params.use_dns_lookup = value

        def set_use_dns_lookup(self, value: bool) -> "AvailabilityCheckerBase":
            """
            Sets the value which authorizes the usage of the DNS Lookup.

            :param value:
                The value to set.
            """

            self.use_dns_lookup = value

            return self

        @property
        def use_netinfo_lookup(self) -> bool:
            """
            Provides the current value of the :code:`_use_netinfo_lookup` attribute.
            """

            return self._use_netinfo_lookup

        @use_netinfo_lookup.setter
        def use_netinfo_lookup(self, value: bool) -> None:
            """
            Sets the value which authorizes the usage of the network information
            lookup.

            :param value:
                The value to set.

            :raise TypeError:
                When the given :code:`value` is not a :py:class:`bool`.
            """

            if not isinstance(value, bool):
                raise TypeError(f"<value> should be {bool}, {type(value)} given.")

            self._use_netinfo_lookup = self.params.use_netinfo_lookup = value

        def set_use_netinfo_lookup(self, value: bool) -> "AvailabilityCheckerBase":
            """
            Sets the value which authorizes the usage of the network information
            lookup.

            :param value:
                The value to set.
            """

            self.use_netinfo_lookup = value

            return self

        @property
        def use_http_code_lookup(self) -> None:
            """
            Provides the current value of the :code:`_use_http_code_lookup` attribute.
            """

            return self._use_http_code_lookup

        @use_http_code_lookup.setter
        def use_http_code_lookup(self, value: bool) -> None:
            """
            Sets the value which authorizes the usage of the HTTP status code
            lookup.

            :param value:
                The value to set.

            :raise TypeError:
                When the given :code:`value` is not a :py:class:`bool`.
            """

            if not isinstance(value, bool):
                raise TypeError(f"<value> should be {bool}, {type(value)} given.")

            self._use_http_code_lookup = self.params.use_http_code_lookup = value

        def set_use_http_code_lookup(self, value: bool) -> "AvailabilityCheckerBase":
            """
            Sets the value which authorizes the usage of the HTTP status code
            lookup.

            :param value:
                The value to set.
            """

            self.use_http_code_lookup = value

            return self

        @property
        def use_reputation_lookup(self) -> bool:
            """
            Provides the current value of the :code:`_use_reputation_lookup` attribute.
            """

            return self._use_reputation_lookup

        @use_reputation_lookup.setter
        def use_reputation_lookup(self, value: bool) -> None:
            """
            Sets the value which authorizes the usage of the reputation
            lookup.

            :param value:
                The value to set.

            :raise TypeError:
                When the given :code:`value` is not a :py:class:`bool`.
            """

            if not isinstance(value, bool):
                raise TypeError(f"<value> should be {bool}, {type(value)} given.")

            self._use_reputation_lookup = self.params.use_reputation_lookup = value

        def set_use_reputation_lookup(self, value: bool) -> "AvailabilityCheckerBase":
            """
            Sets the value which authorizes the usage of the reputation
            lookup.

            :param value:
                The value to set.
            """

            self.use_reputation_lookup = value

            return self

        @property
        def use_whois_db(self) -> bool:
            """
            Provides the current value of the :code:`_use_whois_db` attribute.
            """

            return self._use_whois_db

        @use_whois_db.setter
        def use_whois_db(self, value: bool) -> None:
            """
            Sets the value which authorizes the usage of the WHOIS DB.

            :param value:
                The value to set.

            :param TypeError:
                When the given :code:`use_whois_db` is not a :py:class:`bool`.
            """

            if not isinstance(value, bool):
                raise TypeError(f"<value> should be {bool}, {type(value)} given.")

            self._use_whois_db = self.params.use_whois_db = value

        def set_use_whois_db(self, value: bool) -> "AvailabilityCheckerBase":
            """
            Sets the value which authorizes the usage of the WHOIS DB.

            :param value:
                The value to set.
            """

            self.use_whois_db = value

            return self

        def subject_propagator(self) -> "CheckerBase":
            """
            Propagate the currently set subject.

            .. warning::
                You are not invited to run this method directly.
            """

            self.dns_query_tool.set_subject(self.idna_subject)
            self.whois_query_tool.set_subject(self.idna_subject)
            self.addressinfo_query_tool.set_subject(self.idna_subject)
            self.hostbyaddr_query_tool.set_subject(self.idna_subject)
            self.http_status_code_query_tool.set_subject(self.idna_subject)

            self.domain_syntax_checker.subject = self.idna_subject
            self.ip_syntax_checker.subject = self.idna_subject
            self.url_syntax_checker.subject = self.idna_subject

            if self.status.subject_kind is None:
                self.status = AvailabilityCheckerStatus()
                self.params = AvailabilityCheckerParams()
                self.status.params = self.params

            self.status.dns_lookup_record = self.dns_query_tool.lookup_record
            self.status.whois_lookup_record = self.whois_query_tool.lookup_record

            return super().subject_propagator()

        def should_we_continue_test(self, status_post_syntax_checker: str) -> bool:
            """
            Checks if we are allowed to continue a standard testing.

            Rules:
                1. No status available yet. Continue to next test method.
                2. Status is/still INVALID. Continue to next test method.
                3. Above are False. Not allowed to continue to next test method.
            """

            if not self.status.status:
                return True

            if (
                status_post_syntax_checker == PyFunceble.storage.STATUS.invalid
                and self.status.status == PyFunceble.storage.STATUS.invalid
            ):
                return True

            return False

        def guess_and_set_use_extra_rules(self) -> "AvailabilityCheckerBase":
            """
            Try to guess and set the value of the :code:`use_extra_rules` attribute
            from the configuration file.
            """

            if PyFunceble.facility.ConfigLoader.is_already_loaded():
                self.use_extra_rules = PyFunceble.storage.CONFIGURATION.lookup.special
            else:
                self.use_extra_rules = self.STD_USE_EXTRA_RULES

            return self

        def guess_and_set_use_whois_lookup(self) -> "AvailabilityCheckerBase":
            """
            Try to guess and set the value of the :code:`use_whois` attribute
            from the configuration file.
            """

            if PyFunceble.facility.ConfigLoader.is_already_loaded():
                self.use_whois_lookup = PyFunceble.storage.CONFIGURATION.lookup.whois
            else:
                self.use_whois_lookup = self.STD_USE_WHOIS_LOOKUP

            return self

        def guess_and_set_dns_lookup(self) -> "AvailabilityCheckerBase":
            """
            Try to guess and set the value of the :code:`use_dns_lookup` attribute
            from the configuration file.
            """

            if PyFunceble.facility.ConfigLoader.is_already_loaded():
                self.use_dns_lookup = PyFunceble.storage.CONFIGURATION.lookup.dns
            else:
                self.use_dns_lookup = self.STD_USE_DNS_LOOKUP

            return self

        def guess_and_set_use_netinfo_lookup(self) -> "AvailabilityCheckerBase":
            """
            Try to guess and set the value of the :code:`use_netinfo_lookup` attribute
            from the configuration file.
            """

            if PyFunceble.facility.ConfigLoader.is_already_loaded():
                self.use_netinfo_lookup = PyFunceble.storage.CONFIGURATION.lookup.netinfo
            else:
                self.use_netinfo_lookup = self.STD_USE_NETINFO_LOOKUP

            return self

        def guess_and_set_use_http_code_lookup(self) -> "AvailabilityCheckerBase":
            """
            Try to guess and set the value of the :code:`use_http_code_lookup` attribute
            from the configuration file.
            """

            if PyFunceble.facility.ConfigLoader.is_already_loaded():
                self.use_http_code_lookup = (
                    PyFunceble.storage.CONFIGURATION.lookup.http_status_code
                )
            else:
                self.use_http_code_lookup = self.STD_USE_HTTP_CODE_LOOKUP

            return self

        def guess_and_set_use_reputation_lookup(self) -> "AvailabilityCheckerBase":
            """
            Try to guess and set the value of the :code:`use_reputation_lookup` attribute
            from the configuration file.
            """

            if PyFunceble.facility.ConfigLoader.is_already_loaded():
                self.use_reputation_lookup = (
                    PyFunceble.storage.CONFIGURATION.lookup.reputation
                )
            else:
                self.use_reputation_lookup = self.STD_USE_REPUTATION_LOOKUP

            return self

        def guess_and_set_use_whois_db(self) -> "AvailabilityCheckerBase":
            """
            Try to guess and set the value of the :code:`use_whois_db` attribute.
            """

            if PyFunceble.facility.ConfigLoader.is_already_loaded():
                self.use_whois_db = PyFunceble.storage.CONFIGURATION.cli_testing.whois_db
            else:
                self.use_whois_db = self.STD_USE_WHOIS_DB

        def guess_all_settings(
            self,
        ) -> "AvailabilityCheckerBase":  # pragma: no cover ## Method are more important
            """
            Try to guess all settings.
            """

            to_ignore = ["guess_all_settings"]

            for method in dir(self):
                if method in to_ignore or not method.startswith("guess_"):
                    continue

                getattr(self, method)()

            return self

        def query_common_checker(self) -> "AvailabilityCheckerBase":
            """
            Queries the syntax checker.
            """

            PyFunceble.facility.Logger.info(
                "Started to check the syntax of %r", self.status.idna_subject
            )

            self.status.second_level_domain_syntax = (
                self.domain_syntax_checker.is_valid_second_level()
            )
            self.status.subdomain_syntax = self.domain_syntax_checker.is_valid_subdomain()
            self.status.domain_syntax = bool(self.status.subdomain_syntax) or bool(
                self.status.second_level_domain_syntax
            )

            self.status.ipv4_syntax = self.ip_syntax_checker.is_valid_v4()
            self.status.ipv6_syntax = self.ip_syntax_checker.is_valid_v6()
            self.status.ipv4_range_syntax = self.ip_syntax_checker.is_valid_v4_range()
            self.status.ipv6_range_syntax = self.ip_syntax_checker.is_valid_v6_range()
            self.status.ip_syntax = bool(self.status.ipv4_syntax or self.status.ipv6_syntax)
            self.status.url_syntax = self.url_syntax_checker.is_valid()

            PyFunceble.facility.Logger.info(
                "Finished to check the syntax of %r", self.status.idna_subject
            )

            return super().query_common_checker()

        @CheckerBase.ensure_subject_is_given
        def query_dns_record(self) -> Optional[Dict[str, Optional[List[str]]]]:
            """
            Tries to query the DNS record(s) of the given subject.

            .. versionchanged:: 4.1.0b8.dev
               Lookup order relative to actual subject.
            """

            PyFunceble.facility.Logger.info(
                "Started to try to query the DNS record of %r.",
                self.status.idna_subject,
            )

            result = {}

            if self.status.idna_subject != self.dns_query_tool.subject:
                self.domain_syntax_checker.set_subject(self.dns_query_tool.subject)
                self.ip_syntax_checker.set_subject(self.dns_query_tool.subject)

            if self.domain_syntax_checker.is_valid_subdomain():
                lookup_order = ["NS", "A", "AAAA", "CNAME", "DNAME"]
            elif self.ip_syntax_checker.is_valid():
                lookup_order = ["PTR"]
            else:
                lookup_order = ["NS", "CNAME", "A", "AAAA", "DNAME"]

            if lookup_order:
                for record_type in lookup_order:
                    local_result = self.dns_query_tool.set_query_record_type(
                        record_type
                    ).query()

                    if local_result:
                        result[record_type] = local_result

                        break

            if self.status.idna_subject != self.dns_query_tool.subject:
                # Switch back subject because we don't want to break subsequential calls.
                self.domain_syntax_checker.set_subject(self.status.idna_subject)
                self.ip_syntax_checker.set_subject(self.status.idna_subject)

            PyFunceble.facility.Logger.debug("DNS Record:\n%r", result)

            PyFunceble.facility.Logger.info(
                "Finished to try to query the DNS record of %r",
                self.status.idna_subject,
            )

            return result

        def try_to_query_status_from_whois(
            self,
        ) -> "AvailabilityCheckerBase":
            """
            Tries to get and the status from the WHOIS record.

            .. warning::
                If the configuration is loaded, this method try to query from the
                best database first.

                If it's not found it will try to query it from the best WHOIS server
                then add it into the database (if the expiration date
                extraction is successful).

            .. note::
                The addition into the WHOIS database is only done if this method is
                running in a process with a name that does not starts with
                :code:`PyFunceble` (case sensitive).
            """

            PyFunceble.facility.Logger.info(
                "Started to try to query the status of %r from: WHOIS Lookup",
                self.status.idna_subject,
            )

            if (
                PyFunceble.facility.ConfigLoader.is_already_loaded() and self.use_whois_db
            ):  # pragma: no cover ## Not interesting enough to spend time on it.
                whois_object = get_whois_dataset_object(db_session=self.db_session)
                known_record = whois_object[self.subject]

                if known_record and not isinstance(known_record, dict):
                    # Comes from DB engine.
                    known_record = known_record.to_dict()

                if not known_record:
                    # We assume that expired dataset are never saved into the
                    # dataset.
                    self.status.expiration_date = self.whois_query_tool.expiration_date
                    self.status.registrar = self.whois_query_tool.lookup_record.registrar
                    self.status.whois_record = self.whois_query_tool.lookup_record.record

                    if (
                        self.status.expiration_date
                        and not multiprocessing.current_process().name.startswith(
                            PyFunceble.storage.PROJECT_NAME.lower()
                        )
                    ):
                        whois_object.update(
                            {
                                "subject": self.subject,
                                "idna_subject": self.idna_subject,
                                "expiration_date": self.status.expiration_date,
                                "epoch": str(
                                    int(
                                        datetime.strptime(
                                            self.status.expiration_date, "%d-%b-%Y"
                                        ).timestamp()
                                    )
                                ),
                            }
                        )
                else:
                    # We pass the known record to the lookup record - so that other
                    # methods can use it.
                    self.whois_query_tool.lookup_record.record = known_record.get(
                        "record", None
                    )
                    self.whois_query_tool.lookup_record.expiration_date = known_record.get(
                        "expiration_date", None
                    )
                    self.whois_query_tool.lookup_record.registrar = known_record.get(
                        "registrar", None
                    )
                    self.status.whois_lookup_record = self.whois_query_tool.lookup_record

                    self.status.expiration_date = known_record.get("expiration_date", None)
                    self.status.registrar = known_record.get("registrar", None)
                    self.status.whois_record = None
            else:
                self.status.expiration_date = self.whois_query_tool.expiration_date
                self.status.registrar = self.whois_query_tool.lookup_record.registrar
                self.status.whois_record = self.whois_query_tool.lookup_record.record

            if self.status.expiration_date:
                self.status.status = PyFunceble.storage.STATUS.up
                self.status.status_source = "WHOIS"

                PyFunceble.facility.Logger.info(
                    "Could define the status of %r from: WHOIS Lookup",
                    self.status.idna_subject,
                )

            PyFunceble.facility.Logger.info(
                "Finished to try to query the status of %r from: WHOIS Lookup",
                self.status.idna_subject,
            )

            return self

        def try_to_query_status_from_dns(self) -> "AvailabilityCheckerBase":
            """
            Tries to query the status from the DNS lookup.

            .. versionchanged:: 4.1.0b7.dev
               Logging return the correct subject.
            """

            PyFunceble.facility.Logger.info(
                "Started to try to query the status of %r from: DNS Lookup",
                self.dns_query_tool.subject,
            )

            lookup_result = self.query_dns_record()

            if lookup_result:
                self.status.dns_lookup = lookup_result
                self.status.status = PyFunceble.storage.STATUS.up
                self.status.status_source = "DNSLOOKUP"

                PyFunceble.facility.Logger.info(
                    "Could define the status of %r from: DNS Lookup",
                    self.dns_query_tool.subject,
                )

            PyFunceble.facility.Logger.info(
                "Finished to try to query the status of %r from: DNS Lookup",
                self.dns_query_tool.subject,
            )

            return self

        def try_to_query_status_from_netinfo(self) -> "AvailabilityCheckerBase":
            """
            Tries to query the status from the network information.
            """

            PyFunceble.facility.Logger.info(
                "Started to try to query the status of %r from: NETINFO Lookup",
                self.status.idna_subject,
            )

            if self.status.domain_syntax:
                lookup_result = self.addressinfo_query_tool.get_info()
            elif self.status.ip_syntax:
                lookup_result = self.hostbyaddr_query_tool.get_info()
            elif self.status.idna_subject.isdigit():
                lookup_result = None
            else:
                lookup_result = self.addressinfo_query_tool.get_info()

            if lookup_result:
                self.status.netinfo = lookup_result
                self.status.status = PyFunceble.storage.STATUS.up
                self.status.status_source = "NETINFO"

                PyFunceble.facility.Logger.info(
                    "Could define the status of %r from: NETINFO Lookup",
                    self.status.idna_subject,
                )

            PyFunceble.facility.Logger.info(
                "Finished to try to query the status of %r from: NETINFO Lookup",
                self.status.idna_subject,
            )

            return self

        def try_to_query_status_from_http_status_code(
            self, *, from_domain_test: bool = False
        ) -> "AvailabilityCheckerBase":
            """
            Tries to query the status from the HTTP status code.

            :param bool from_domain_test:
                Whether we wanted to test a test - actually.

                Setting this argument to :py:class:`True` will exit the http_status_code
                test if the given subject is already a URL.
            """

            PyFunceble.facility.Logger.info(
                "Started to try to query the status of %r from: HTTP Status code Lookup",
                self.status.idna_subject,
            )

            if from_domain_test and self.status.url_syntax:
                return self

            if not self.status.url_syntax and not self.idna_subject.startswith("http"):
                self.http_status_code_query_tool.set_subject(
                    f"http://{self.idna_subject}:80"
                )

            lookup_result = self.http_status_code_query_tool.get_status_code()

            if (
                lookup_result
                and lookup_result
                != self.http_status_code_query_tool.STD_UNKNOWN_STATUS_CODE
            ):
                self.status.http_status_code = lookup_result

                if (
                    PyFunceble.facility.ConfigLoader.is_already_loaded()
                ):  # pragma: no cover ## Special behavior.
                    dataset = PyFunceble.storage.HTTP_CODES
                else:
                    dataset = PyFunceble.storage.STD_HTTP_CODES

                if (
                    not self.status.status
                    or self.status.status == PyFunceble.storage.STATUS.down
                ) and (
                    self.status.http_status_code in dataset.list.up
                    or self.status.http_status_code in dataset.list.potentially_up
                ):
                    self.status.status = PyFunceble.storage.STATUS.up
                    self.status.status_source = "HTTP CODE"

                    PyFunceble.facility.Logger.info(
                        "Could define the status of %r from: HTTP Status code Lookup",
                        self.status.idna_subject,
                    )
            else:
                self.status.http_status_code = None

            PyFunceble.facility.Logger.info(
                "Finished to try to query the status of %r from: HTTP Status code Lookup",
                self.status.idna_subject,
            )

            return self

        def try_to_query_status_from_syntax_lookup(
            self, from_domain_test: bool = False, from_url_test: bool = False
        ) -> "AvailabilityCheckerBase":
            """
            Tries to query the status from the syntax.

            :param bool from_domain_test:
                Whether we wanted to test a domain - actually.

                Setting this argument to :py:class:`True` will assume that we are
                exclusively checking the syntax of domain/ip.
            :param bool from_url_test:
                Whether we wanted to test a url - actually.

                Setting this argument to :py:class:`True` will assume that we are
                exclusively checking the syntax of url.
            """

            PyFunceble.facility.Logger.info(
                "Started to try to query the status of %r from: Syntax Lookup",
                self.status.idna_subject,
            )

            if from_domain_test:
                is_invalid = not self.status.domain_syntax and not self.status.ip_syntax
            elif from_url_test:
                is_invalid = not self.status.url_syntax
            else:
                is_invalid = (
                    not self.status.domain_syntax
                    and not self.status.ip_syntax
                    and not self.status.url_syntax
                )

            if is_invalid:
                self.status.status = PyFunceble.storage.STATUS.invalid
                self.status.status_source = "SYNTAX"

                PyFunceble.facility.Logger.info(
                    "Could define the status of %r from: Syntax Lookup",
                    self.status.idna_subject,
                )

            PyFunceble.facility.Logger.info(
                "Finished to try to query the status of %r from: Syntax Lookup",
                self.status.idna_subject,
            )

            return self

        def try_to_query_status_from_reputation(self) -> "AvailabilityCheckerBase":
            """
            Tries to query the status from the reputation lookup.
            """

            raise NotImplementedError()

        def try_to_query_status_from_platform(self) -> "AvailabilityCheckerBase":
            """
            Tries to get and set the status from the platform API.
            """

            PyFunceble.facility.Logger.info(
                "Started to try to query the status of %r from: Platform Lookup",
                self.status.idna_subject,
            )

            data = self.platform_query_tool.pull(self.idna_subject)

            if data and "status" in data:
                try:
                    if (
                        self.platform_query_tool.preferred_status_origin == "frequent"
                        and data["status"]["availability"]["frequent"]
                    ):
                        self.status.status = data["status"]["availability"]["frequent"]
                        self.status.status_source = "PLATFORM"
                    elif (
                        self.platform_query_tool.preferred_status_origin == "latest"
                        and data["status"]["availability"]["latest"]
                    ):
                        try:
                            # legacy
                            self.status.status = data["status"]["availability"]["latest"][
                                "status"
                            ]
                        except (KeyError, TypeError):
                            self.status.status = data["status"]["availability"]["latest"]
                        self.status.status_source = "PLATFORM"
                    elif (
                        self.platform_query_tool.preferred_status_origin == "recommended"
                        and data["status"]["availability"]["recommended"]
                    ):
                        self.status.status = data["status"]["availability"]["recommended"]
                        self.status.status_source = "PLATFORM"
                except (KeyError, TypeError):
                    PyFunceble.facility.Logger.info(
                        "Could define the status of %r from: Platform Lookup",
                        self.status.idna_subject,
                    )

            PyFunceble.facility.Logger.info(
                "Finished to try to query the status of %r from: Platform Lookup",
                self.status.idna_subject,
            )

            return self

        def try_to_query_status_from_extra_rules(self) -> "AvailabilityCheckerBase":
            """
            Tries to query the status from the extra rules.
            """

            PyFunceble.facility.Logger.info(
                "Started to try to query the status of %r from: Extra Rules Lookup",
                self.status.idna_subject,
            )

            if self.use_extra_rules:
                for rule_handler in self.extra_rules_handlers:
                    rule_handler.set_status(self.status).start()

                    if self.status.status_after_extra_rules:
                        PyFunceble.facility.Logger.info(
                            "Could define the status of %r from: Extra Rules Lookup",
                            self.status.idna_subject,
                        )
                        break

            PyFunceble.facility.Logger.info(
                "Finished to try to query the status of %r from: Extra Rules Lookup",
                self.status.idna_subject,
            )

            return self

        @CheckerBase.ensure_subject_is_given
        @CheckerBase.update_status_date_after_query
        def query_status(self) -> "AvailabilityCheckerBase":
            """
            Queries the status and for for more action.
            """

            raise NotImplementedError()

        # pylint: disable=useless-super-delegation
        def get_status(self) -> Optional[AvailabilityCheckerStatus]:
            return super().get_status()

### `use_dns_lookup` `property` `writable`

Provides the current value of the :code:`_use_dns_lookup` attribute.

### `use_extra_rules` `property` `writable`

Provides the current value of the :code:`_use_extra_rules` attribute.

### `use_http_code_lookup` `property` `writable`

Provides the current value of the :code:`_use_http_code_lookup` attribute.

### `use_netinfo_lookup` `property` `writable`

Provides the current value of the :code:`_use_netinfo_lookup` attribute.

### `use_reputation_lookup` `property` `writable`

Provides the current value of the :code:`_use_reputation_lookup` attribute.

### `use_whois_db` `property` `writable`

Provides the current value of the :code:`_use_whois_db` attribute.

### `use_whois_lookup` `property` `writable`

Provides the current value of the :code:`_use_whois_lookup` attribute.

### `guess_all_settings()`

Try to guess all settings.

Source code in `PyFunceble/checker/availability/base.py`

    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652

    def guess_all_settings(
        self,
    ) -> "AvailabilityCheckerBase":  # pragma: no cover ## Method are more important
        """
        Try to guess all settings.
        """

        to_ignore = ["guess_all_settings"]

        for method in dir(self):
            if method in to_ignore or not method.startswith("guess_"):
                continue

            getattr(self, method)()

        return self

### `guess_and_set_dns_lookup()`

Try to guess and set the value of the :code:`use_dns_lookup` attribute from the configuration file.

Source code in `PyFunceble/checker/availability/base.py`

    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582

    def guess_and_set_dns_lookup(self) -> "AvailabilityCheckerBase":
        """
        Try to guess and set the value of the :code:`use_dns_lookup` attribute
        from the configuration file.
        """

        if PyFunceble.facility.ConfigLoader.is_already_loaded():
            self.use_dns_lookup = PyFunceble.storage.CONFIGURATION.lookup.dns
        else:
            self.use_dns_lookup = self.STD_USE_DNS_LOOKUP

        return self

### `guess_and_set_use_extra_rules()`

Try to guess and set the value of the :code:`use_extra_rules` attribute from the configuration file.

Source code in `PyFunceble/checker/availability/base.py`

    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556

    def guess_and_set_use_extra_rules(self) -> "AvailabilityCheckerBase":
        """
        Try to guess and set the value of the :code:`use_extra_rules` attribute
        from the configuration file.
        """

        if PyFunceble.facility.ConfigLoader.is_already_loaded():
            self.use_extra_rules = PyFunceble.storage.CONFIGURATION.lookup.special
        else:
            self.use_extra_rules = self.STD_USE_EXTRA_RULES

        return self

### `guess_and_set_use_http_code_lookup()`

Try to guess and set the value of the :code:`use_http_code_lookup` attribute from the configuration file.

Source code in `PyFunceble/checker/availability/base.py`

    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610

    def guess_and_set_use_http_code_lookup(self) -> "AvailabilityCheckerBase":
        """
        Try to guess and set the value of the :code:`use_http_code_lookup` attribute
        from the configuration file.
        """

        if PyFunceble.facility.ConfigLoader.is_already_loaded():
            self.use_http_code_lookup = (
                PyFunceble.storage.CONFIGURATION.lookup.http_status_code
            )
        else:
            self.use_http_code_lookup = self.STD_USE_HTTP_CODE_LOOKUP

        return self

### `guess_and_set_use_netinfo_lookup()`

Try to guess and set the value of the :code:`use_netinfo_lookup` attribute from the configuration file.

Source code in `PyFunceble/checker/availability/base.py`

    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595

    def guess_and_set_use_netinfo_lookup(self) -> "AvailabilityCheckerBase":
        """
        Try to guess and set the value of the :code:`use_netinfo_lookup` attribute
        from the configuration file.
        """

        if PyFunceble.facility.ConfigLoader.is_already_loaded():
            self.use_netinfo_lookup = PyFunceble.storage.CONFIGURATION.lookup.netinfo
        else:
            self.use_netinfo_lookup = self.STD_USE_NETINFO_LOOKUP

        return self

### `guess_and_set_use_reputation_lookup()`

Try to guess and set the value of the :code:`use_reputation_lookup` attribute from the configuration file.

Source code in `PyFunceble/checker/availability/base.py`

    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625

    def guess_and_set_use_reputation_lookup(self) -> "AvailabilityCheckerBase":
        """
        Try to guess and set the value of the :code:`use_reputation_lookup` attribute
        from the configuration file.
        """

        if PyFunceble.facility.ConfigLoader.is_already_loaded():
            self.use_reputation_lookup = (
                PyFunceble.storage.CONFIGURATION.lookup.reputation
            )
        else:
            self.use_reputation_lookup = self.STD_USE_REPUTATION_LOOKUP

        return self

### `guess_and_set_use_whois_db()`

Try to guess and set the value of the :code:`use_whois_db` attribute.

Source code in `PyFunceble/checker/availability/base.py`

    627
    628
    629
    630
    631
    632
    633
    634
    635

    def guess_and_set_use_whois_db(self) -> "AvailabilityCheckerBase":
        """
        Try to guess and set the value of the :code:`use_whois_db` attribute.
        """

        if PyFunceble.facility.ConfigLoader.is_already_loaded():
            self.use_whois_db = PyFunceble.storage.CONFIGURATION.cli_testing.whois_db
        else:
            self.use_whois_db = self.STD_USE_WHOIS_DB

### `guess_and_set_use_whois_lookup()`

Try to guess and set the value of the :code:`use_whois` attribute from the configuration file.

Source code in `PyFunceble/checker/availability/base.py`

    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569

    def guess_and_set_use_whois_lookup(self) -> "AvailabilityCheckerBase":
        """
        Try to guess and set the value of the :code:`use_whois` attribute
        from the configuration file.
        """

        if PyFunceble.facility.ConfigLoader.is_already_loaded():
            self.use_whois_lookup = PyFunceble.storage.CONFIGURATION.lookup.whois
        else:
            self.use_whois_lookup = self.STD_USE_WHOIS_LOOKUP

        return self

### `query_common_checker()`

Queries the syntax checker.

Source code in `PyFunceble/checker/availability/base.py`

    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682

    def query_common_checker(self) -> "AvailabilityCheckerBase":
        """
        Queries the syntax checker.
        """

        PyFunceble.facility.Logger.info(
            "Started to check the syntax of %r", self.status.idna_subject
        )

        self.status.second_level_domain_syntax = (
            self.domain_syntax_checker.is_valid_second_level()
        )
        self.status.subdomain_syntax = self.domain_syntax_checker.is_valid_subdomain()
        self.status.domain_syntax = bool(self.status.subdomain_syntax) or bool(
            self.status.second_level_domain_syntax
        )

        self.status.ipv4_syntax = self.ip_syntax_checker.is_valid_v4()
        self.status.ipv6_syntax = self.ip_syntax_checker.is_valid_v6()
        self.status.ipv4_range_syntax = self.ip_syntax_checker.is_valid_v4_range()
        self.status.ipv6_range_syntax = self.ip_syntax_checker.is_valid_v6_range()
        self.status.ip_syntax = bool(self.status.ipv4_syntax or self.status.ipv6_syntax)
        self.status.url_syntax = self.url_syntax_checker.is_valid()

        PyFunceble.facility.Logger.info(
            "Finished to check the syntax of %r", self.status.idna_subject
        )

        return super().query_common_checker()

### `query_dns_record()`

Tries to query the DNS record(s) of the given subject.

.. versionchanged:: 4.1.0b8.dev Lookup order relative to actual subject.

Source code in `PyFunceble/checker/availability/base.py`

    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734

    @CheckerBase.ensure_subject_is_given
    def query_dns_record(self) -> Optional[Dict[str, Optional[List[str]]]]:
        """
        Tries to query the DNS record(s) of the given subject.

        .. versionchanged:: 4.1.0b8.dev
           Lookup order relative to actual subject.
        """

        PyFunceble.facility.Logger.info(
            "Started to try to query the DNS record of %r.",
            self.status.idna_subject,
        )

        result = {}

        if self.status.idna_subject != self.dns_query_tool.subject:
            self.domain_syntax_checker.set_subject(self.dns_query_tool.subject)
            self.ip_syntax_checker.set_subject(self.dns_query_tool.subject)

        if self.domain_syntax_checker.is_valid_subdomain():
            lookup_order = ["NS", "A", "AAAA", "CNAME", "DNAME"]
        elif self.ip_syntax_checker.is_valid():
            lookup_order = ["PTR"]
        else:
            lookup_order = ["NS", "CNAME", "A", "AAAA", "DNAME"]

        if lookup_order:
            for record_type in lookup_order:
                local_result = self.dns_query_tool.set_query_record_type(
                    record_type
                ).query()

                if local_result:
                    result[record_type] = local_result

                    break

        if self.status.idna_subject != self.dns_query_tool.subject:
            # Switch back subject because we don't want to break subsequential calls.
            self.domain_syntax_checker.set_subject(self.status.idna_subject)
            self.ip_syntax_checker.set_subject(self.status.idna_subject)

        PyFunceble.facility.Logger.debug("DNS Record:\n%r", result)

        PyFunceble.facility.Logger.info(
            "Finished to try to query the DNS record of %r",
            self.status.idna_subject,
        )

        return result

### `query_status()`

Queries the status and for for more action.

Source code in `PyFunceble/checker/availability/base.py`

    1106
    1107
    1108
    1109
    1110
    1111
    1112
    1113

    @CheckerBase.ensure_subject_is_given
    @CheckerBase.update_status_date_after_query
    def query_status(self) -> "AvailabilityCheckerBase":
        """
        Queries the status and for for more action.
        """

        raise NotImplementedError()

### `set_use_dns_lookup(value)`

Sets the value which authorizes the usage of the DNS Lookup.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`value` | `bool` | The value to set. | required

Source code in `PyFunceble/checker/availability/base.py`

    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340

    def set_use_dns_lookup(self, value: bool) -> "AvailabilityCheckerBase":
        """
        Sets the value which authorizes the usage of the DNS Lookup.

        :param value:
            The value to set.
        """

        self.use_dns_lookup = value

        return self

### `set_use_extra_rules(value)`

Sets the value which authorizes the usage of the special rule.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`value` | `bool` | The value to set. | required

Source code in `PyFunceble/checker/availability/base.py`

    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266

    def set_use_extra_rules(self, value: bool) -> "AvailabilityCheckerBase":
        """
        Sets the value which authorizes the usage of the special rule.

        :param value:
            The value to set.
        """

        self.use_extra_rules = value

        return self

### `set_use_http_code_lookup(value)`

Sets the value which authorizes the usage of the HTTP status code lookup.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`value` | `bool` | The value to set. | required

Source code in `PyFunceble/checker/availability/base.py`

    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418

    def set_use_http_code_lookup(self, value: bool) -> "AvailabilityCheckerBase":
        """
        Sets the value which authorizes the usage of the HTTP status code
        lookup.

        :param value:
            The value to set.
        """

        self.use_http_code_lookup = value

        return self

### `set_use_netinfo_lookup(value)`

Sets the value which authorizes the usage of the network information lookup.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`value` | `bool` | The value to set. | required

Source code in `PyFunceble/checker/availability/base.py`

    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379

    def set_use_netinfo_lookup(self, value: bool) -> "AvailabilityCheckerBase":
        """
        Sets the value which authorizes the usage of the network information
        lookup.

        :param value:
            The value to set.
        """

        self.use_netinfo_lookup = value

        return self

### `set_use_reputation_lookup(value)`

Sets the value which authorizes the usage of the reputation lookup.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`value` | `bool` | The value to set. | required

Source code in `PyFunceble/checker/availability/base.py`

    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457

    def set_use_reputation_lookup(self, value: bool) -> "AvailabilityCheckerBase":
        """
        Sets the value which authorizes the usage of the reputation
        lookup.

        :param value:
            The value to set.
        """

        self.use_reputation_lookup = value

        return self

### `set_use_whois_db(value)`

Sets the value which authorizes the usage of the WHOIS DB.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`value` | `bool` | The value to set. | required

Source code in `PyFunceble/checker/availability/base.py`

    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494

    def set_use_whois_db(self, value: bool) -> "AvailabilityCheckerBase":
        """
        Sets the value which authorizes the usage of the WHOIS DB.

        :param value:
            The value to set.
        """

        self.use_whois_db = value

        return self

### `set_use_whois_lookup(value)`

Sets the value which authorizes the usage of the WHOIS lookup.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`value` | `bool` | The value to set. | required

Source code in `PyFunceble/checker/availability/base.py`

    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303

    def set_use_whois_lookup(self, value: bool) -> "AvailabilityCheckerBase":
        """
        Sets the value which authorizes the usage of the WHOIS lookup.

        :param value:
            The value to set.
        """

        self.use_whois_lookup = value

        return self

### `should_we_continue_test(status_post_syntax_checker)`

Checks if we are allowed to continue a standard testing.

Rules: 1. No status available yet. Continue to next test method. 2. Status is/still INVALID. Continue to next test method. 3. Above are False. Not allowed to continue to next test method.

Source code in `PyFunceble/checker/availability/base.py`

    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543

    def should_we_continue_test(self, status_post_syntax_checker: str) -> bool:
        """
        Checks if we are allowed to continue a standard testing.

        Rules:
            1. No status available yet. Continue to next test method.
            2. Status is/still INVALID. Continue to next test method.
            3. Above are False. Not allowed to continue to next test method.
        """

        if not self.status.status:
            return True

        if (
            status_post_syntax_checker == PyFunceble.storage.STATUS.invalid
            and self.status.status == PyFunceble.storage.STATUS.invalid
        ):
            return True

        return False

### `subject_propagator()`

Propagate the currently set subject.

.. warning:: You are not invited to run this method directly.

Source code in `PyFunceble/checker/availability/base.py`

    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522

    def subject_propagator(self) -> "CheckerBase":
        """
        Propagate the currently set subject.

        .. warning::
            You are not invited to run this method directly.
        """

        self.dns_query_tool.set_subject(self.idna_subject)
        self.whois_query_tool.set_subject(self.idna_subject)
        self.addressinfo_query_tool.set_subject(self.idna_subject)
        self.hostbyaddr_query_tool.set_subject(self.idna_subject)
        self.http_status_code_query_tool.set_subject(self.idna_subject)

        self.domain_syntax_checker.subject = self.idna_subject
        self.ip_syntax_checker.subject = self.idna_subject
        self.url_syntax_checker.subject = self.idna_subject

        if self.status.subject_kind is None:
            self.status = AvailabilityCheckerStatus()
            self.params = AvailabilityCheckerParams()
            self.status.params = self.params

        self.status.dns_lookup_record = self.dns_query_tool.lookup_record
        self.status.whois_lookup_record = self.whois_query_tool.lookup_record

        return super().subject_propagator()

### `try_to_query_status_from_dns()`

Tries to query the status from the DNS lookup.

.. versionchanged:: 4.1.0b7.dev Logging return the correct subject.

Source code in `PyFunceble/checker/availability/base.py`

    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866

    def try_to_query_status_from_dns(self) -> "AvailabilityCheckerBase":
        """
        Tries to query the status from the DNS lookup.

        .. versionchanged:: 4.1.0b7.dev
           Logging return the correct subject.
        """

        PyFunceble.facility.Logger.info(
            "Started to try to query the status of %r from: DNS Lookup",
            self.dns_query_tool.subject,
        )

        lookup_result = self.query_dns_record()

        if lookup_result:
            self.status.dns_lookup = lookup_result
            self.status.status = PyFunceble.storage.STATUS.up
            self.status.status_source = "DNSLOOKUP"

            PyFunceble.facility.Logger.info(
                "Could define the status of %r from: DNS Lookup",
                self.dns_query_tool.subject,
            )

        PyFunceble.facility.Logger.info(
            "Finished to try to query the status of %r from: DNS Lookup",
            self.dns_query_tool.subject,
        )

        return self

### `try_to_query_status_from_extra_rules()`

Tries to query the status from the extra rules.

Source code in `PyFunceble/checker/availability/base.py`

    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    1101
    1102
    1103
    1104

    def try_to_query_status_from_extra_rules(self) -> "AvailabilityCheckerBase":
        """
        Tries to query the status from the extra rules.
        """

        PyFunceble.facility.Logger.info(
            "Started to try to query the status of %r from: Extra Rules Lookup",
            self.status.idna_subject,
        )

        if self.use_extra_rules:
            for rule_handler in self.extra_rules_handlers:
                rule_handler.set_status(self.status).start()

                if self.status.status_after_extra_rules:
                    PyFunceble.facility.Logger.info(
                        "Could define the status of %r from: Extra Rules Lookup",
                        self.status.idna_subject,
                    )
                    break

        PyFunceble.facility.Logger.info(
            "Finished to try to query the status of %r from: Extra Rules Lookup",
            self.status.idna_subject,
        )

        return self

### `try_to_query_status_from_http_status_code(*, from_domain_test=False)`

Tries to query the status from the HTTP status code.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`from_domain_test` | `bool` | Whether we wanted to test a test - actually. Setting this argument to class:`True` will exit the http_status_code test if the given subject is already a URL. | `False`

Source code in `PyFunceble/checker/availability/base.py`

    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968

    def try_to_query_status_from_http_status_code(
        self, *, from_domain_test: bool = False
    ) -> "AvailabilityCheckerBase":
        """
        Tries to query the status from the HTTP status code.

        :param bool from_domain_test:
            Whether we wanted to test a test - actually.

            Setting this argument to :py:class:`True` will exit the http_status_code
            test if the given subject is already a URL.
        """

        PyFunceble.facility.Logger.info(
            "Started to try to query the status of %r from: HTTP Status code Lookup",
            self.status.idna_subject,
        )

        if from_domain_test and self.status.url_syntax:
            return self

        if not self.status.url_syntax and not self.idna_subject.startswith("http"):
            self.http_status_code_query_tool.set_subject(
                f"http://{self.idna_subject}:80"
            )

        lookup_result = self.http_status_code_query_tool.get_status_code()

        if (
            lookup_result
            and lookup_result
            != self.http_status_code_query_tool.STD_UNKNOWN_STATUS_CODE
        ):
            self.status.http_status_code = lookup_result

            if (
                PyFunceble.facility.ConfigLoader.is_already_loaded()
            ):  # pragma: no cover ## Special behavior.
                dataset = PyFunceble.storage.HTTP_CODES
            else:
                dataset = PyFunceble.storage.STD_HTTP_CODES

            if (
                not self.status.status
                or self.status.status == PyFunceble.storage.STATUS.down
            ) and (
                self.status.http_status_code in dataset.list.up
                or self.status.http_status_code in dataset.list.potentially_up
            ):
                self.status.status = PyFunceble.storage.STATUS.up
                self.status.status_source = "HTTP CODE"

                PyFunceble.facility.Logger.info(
                    "Could define the status of %r from: HTTP Status code Lookup",
                    self.status.idna_subject,
                )
        else:
            self.status.http_status_code = None

        PyFunceble.facility.Logger.info(
            "Finished to try to query the status of %r from: HTTP Status code Lookup",
            self.status.idna_subject,
        )

        return self

### `try_to_query_status_from_netinfo()`

Tries to query the status from the network information.

Source code in `PyFunceble/checker/availability/base.py`

    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902

    def try_to_query_status_from_netinfo(self) -> "AvailabilityCheckerBase":
        """
        Tries to query the status from the network information.
        """

        PyFunceble.facility.Logger.info(
            "Started to try to query the status of %r from: NETINFO Lookup",
            self.status.idna_subject,
        )

        if self.status.domain_syntax:
            lookup_result = self.addressinfo_query_tool.get_info()
        elif self.status.ip_syntax:
            lookup_result = self.hostbyaddr_query_tool.get_info()
        elif self.status.idna_subject.isdigit():
            lookup_result = None
        else:
            lookup_result = self.addressinfo_query_tool.get_info()

        if lookup_result:
            self.status.netinfo = lookup_result
            self.status.status = PyFunceble.storage.STATUS.up
            self.status.status_source = "NETINFO"

            PyFunceble.facility.Logger.info(
                "Could define the status of %r from: NETINFO Lookup",
                self.status.idna_subject,
            )

        PyFunceble.facility.Logger.info(
            "Finished to try to query the status of %r from: NETINFO Lookup",
            self.status.idna_subject,
        )

        return self

### `try_to_query_status_from_platform()`

Tries to get and set the status from the platform API.

Source code in `PyFunceble/checker/availability/base.py`

    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076

    def try_to_query_status_from_platform(self) -> "AvailabilityCheckerBase":
        """
        Tries to get and set the status from the platform API.
        """

        PyFunceble.facility.Logger.info(
            "Started to try to query the status of %r from: Platform Lookup",
            self.status.idna_subject,
        )

        data = self.platform_query_tool.pull(self.idna_subject)

        if data and "status" in data:
            try:
                if (
                    self.platform_query_tool.preferred_status_origin == "frequent"
                    and data["status"]["availability"]["frequent"]
                ):
                    self.status.status = data["status"]["availability"]["frequent"]
                    self.status.status_source = "PLATFORM"
                elif (
                    self.platform_query_tool.preferred_status_origin == "latest"
                    and data["status"]["availability"]["latest"]
                ):
                    try:
                        # legacy
                        self.status.status = data["status"]["availability"]["latest"][
                            "status"
                        ]
                    except (KeyError, TypeError):
                        self.status.status = data["status"]["availability"]["latest"]
                    self.status.status_source = "PLATFORM"
                elif (
                    self.platform_query_tool.preferred_status_origin == "recommended"
                    and data["status"]["availability"]["recommended"]
                ):
                    self.status.status = data["status"]["availability"]["recommended"]
                    self.status.status_source = "PLATFORM"
            except (KeyError, TypeError):
                PyFunceble.facility.Logger.info(
                    "Could define the status of %r from: Platform Lookup",
                    self.status.idna_subject,
                )

        PyFunceble.facility.Logger.info(
            "Finished to try to query the status of %r from: Platform Lookup",
            self.status.idna_subject,
        )

        return self

### `try_to_query_status_from_reputation()`

Tries to query the status from the reputation lookup.

Source code in `PyFunceble/checker/availability/base.py`

    1020
    1021
    1022
    1023
    1024
    1025

    def try_to_query_status_from_reputation(self) -> "AvailabilityCheckerBase":
        """
        Tries to query the status from the reputation lookup.
        """

        raise NotImplementedError()

### `try_to_query_status_from_syntax_lookup(from_domain_test=False, from_url_test=False)`

Tries to query the status from the syntax.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`from_domain_test` | `bool` | Whether we wanted to test a domain - actually. Setting this argument to class:`True` will assume that we are exclusively checking the syntax of domain/ip. | `False`
`from_url_test` | `bool` | Whether we wanted to test a url - actually. Setting this argument to class:`True` will assume that we are exclusively checking the syntax of url. | `False`

Source code in `PyFunceble/checker/availability/base.py`

     970
     971
     972
     973
     974
     975
     976
     977
     978
     979
     980
     981
     982
     983
     984
     985
     986
     987
     988
     989
     990
     991
     992
     993
     994
     995
     996
     997
     998
     999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018

    def try_to_query_status_from_syntax_lookup(
        self, from_domain_test: bool = False, from_url_test: bool = False
    ) -> "AvailabilityCheckerBase":
        """
        Tries to query the status from the syntax.

        :param bool from_domain_test:
            Whether we wanted to test a domain - actually.

            Setting this argument to :py:class:`True` will assume that we are
            exclusively checking the syntax of domain/ip.
        :param bool from_url_test:
            Whether we wanted to test a url - actually.

            Setting this argument to :py:class:`True` will assume that we are
            exclusively checking the syntax of url.
        """

        PyFunceble.facility.Logger.info(
            "Started to try to query the status of %r from: Syntax Lookup",
            self.status.idna_subject,
        )

        if from_domain_test:
            is_invalid = not self.status.domain_syntax and not self.status.ip_syntax
        elif from_url_test:
            is_invalid = not self.status.url_syntax
        else:
            is_invalid = (
                not self.status.domain_syntax
                and not self.status.ip_syntax
                and not self.status.url_syntax
            )

        if is_invalid:
            self.status.status = PyFunceble.storage.STATUS.invalid
            self.status.status_source = "SYNTAX"

            PyFunceble.facility.Logger.info(
                "Could define the status of %r from: Syntax Lookup",
                self.status.idna_subject,
            )

        PyFunceble.facility.Logger.info(
            "Finished to try to query the status of %r from: Syntax Lookup",
            self.status.idna_subject,
        )

        return self

### `try_to_query_status_from_whois()`

Tries to get and the status from the WHOIS record.

.. warning:: If the configuration is loaded, this method try to query from the best database first.

    If it's not found it will try to query it from the best WHOIS server
    then add it into the database (if the expiration date
    extraction is successful).

.. note:: The addition into the WHOIS database is only done if this method is running in a process with a name that does not starts with :code:`PyFunceble` (case sensitive).

Source code in `PyFunceble/checker/availability/base.py`

    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834

    def try_to_query_status_from_whois(
        self,
    ) -> "AvailabilityCheckerBase":
        """
        Tries to get and the status from the WHOIS record.

        .. warning::
            If the configuration is loaded, this method try to query from the
            best database first.

            If it's not found it will try to query it from the best WHOIS server
            then add it into the database (if the expiration date
            extraction is successful).

        .. note::
            The addition into the WHOIS database is only done if this method is
            running in a process with a name that does not starts with
            :code:`PyFunceble` (case sensitive).
        """

        PyFunceble.facility.Logger.info(
            "Started to try to query the status of %r from: WHOIS Lookup",
            self.status.idna_subject,
        )

        if (
            PyFunceble.facility.ConfigLoader.is_already_loaded() and self.use_whois_db
        ):  # pragma: no cover ## Not interesting enough to spend time on it.
            whois_object = get_whois_dataset_object(db_session=self.db_session)
            known_record = whois_object[self.subject]

            if known_record and not isinstance(known_record, dict):
                # Comes from DB engine.
                known_record = known_record.to_dict()

            if not known_record:
                # We assume that expired dataset are never saved into the
                # dataset.
                self.status.expiration_date = self.whois_query_tool.expiration_date
                self.status.registrar = self.whois_query_tool.lookup_record.registrar
                self.status.whois_record = self.whois_query_tool.lookup_record.record

                if (
                    self.status.expiration_date
                    and not multiprocessing.current_process().name.startswith(
                        PyFunceble.storage.PROJECT_NAME.lower()
                    )
                ):
                    whois_object.update(
                        {
                            "subject": self.subject,
                            "idna_subject": self.idna_subject,
                            "expiration_date": self.status.expiration_date,
                            "epoch": str(
                                int(
                                    datetime.strptime(
                                        self.status.expiration_date, "%d-%b-%Y"
                                    ).timestamp()
                                )
                            ),
                        }
                    )
            else:
                # We pass the known record to the lookup record - so that other
                # methods can use it.
                self.whois_query_tool.lookup_record.record = known_record.get(
                    "record", None
                )
                self.whois_query_tool.lookup_record.expiration_date = known_record.get(
                    "expiration_date", None
                )
                self.whois_query_tool.lookup_record.registrar = known_record.get(
                    "registrar", None
                )
                self.status.whois_lookup_record = self.whois_query_tool.lookup_record

                self.status.expiration_date = known_record.get("expiration_date", None)
                self.status.registrar = known_record.get("registrar", None)
                self.status.whois_record = None
        else:
            self.status.expiration_date = self.whois_query_tool.expiration_date
            self.status.registrar = self.whois_query_tool.lookup_record.registrar
            self.status.whois_record = self.whois_query_tool.lookup_record.record

        if self.status.expiration_date:
            self.status.status = PyFunceble.storage.STATUS.up
            self.status.status_source = "WHOIS"

            PyFunceble.facility.Logger.info(
                "Could define the status of %r from: WHOIS Lookup",
                self.status.idna_subject,
            )

        PyFunceble.facility.Logger.info(
            "Finished to try to query the status of %r from: WHOIS Lookup",
            self.status.idna_subject,
        )

        return self