• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

funilrys / PyFunceble / 5109997145

pending completion
5109997145

push

github-actions

funilrys
Merge remote-tracking branch 'origin/dev' into mtest

296 of 461 new or added lines in 39 files covered. (64.21%)

11297 of 11853 relevant lines covered (95.31%)

11.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

52.63
/PyFunceble/checker/availability/extras/dns.py
1
"""
2
The tool to check the availability or syntax of domain, IP or URL.
3

4
::
5

6

7
    ██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
8
    ██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
9
    ██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
10
    ██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
11
    ██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
12
    ╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
13

14
Provides the extra rules handler based on some DNS records.
15

16
Author:
17
    Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
18

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

22
Contributors:
23
    https://pyfunceble.github.io/#/contributors
24

25
Project link:
26
    https://github.com/funilrys/PyFunceble
27

28
Project documentation:
29
    https://pyfunceble.readthedocs.io/en/dev/
30

31
Project homepage:
32
    https://pyfunceble.github.io/
33

34
License:
35
::
36

37

38
    Copyright 2017, 2018, 2019, 2020, 2022, 2023 Nissar Chababy
39

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

44
        http://www.apache.org/licenses/LICENSE-2.0
45

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

53
from typing import Optional
12✔
54

55
import PyFunceble.facility
12✔
56
from PyFunceble.checker.availability.extras.base import ExtraRuleHandlerBase
12✔
57
from PyFunceble.checker.availability.status import AvailabilityCheckerStatus
12✔
58

59

60
class DNSRulesHandler(ExtraRuleHandlerBase):
12✔
61
    """
62
    Provides our very own sets of DNS based rules.
63

64
    :param status:
65
        The previously gathered status.
66
    :type status:
67
        :class:`~PyFunceble.checker.availability.status.AvailabilityCheckerStatus`
68
    """
69

70
    rulesets: dict = {}
12✔
71

72
    def __init__(self, status: Optional[AvailabilityCheckerStatus] = None) -> None:
73
        self.rulesets = {
74
            r"\.(25u\.com|2waky\.com|3-a\.net|4dq\.com|4pu\.com|acmetoy\.com|"
75
            r"almostmy\.com|americanunfinished\.com|as19557\.net|"
76
            r"authorizeddns\.net|authorizeddns\.org|authorizeddns\.us|"
77
            r"b0tnet\.com|bigmoney\.biz|changeip\.biz|changeip\.co|"
78
            r"changeip\.net|changeip\.org|changeip\.us|cleansite\.biz|"
79
            r"cleansite\.info|cleansite\.us|ddns\.info|ddns\.mobi|ddns\.ms|"
80
            r"ddns\.us|dhcp\.biz|dns-dns\.com|dns-report\.com|dns-stuff\.com|"
81
            r"dns04\.com|dns05\.com|dns1\.us|dns2\.us|dnset\.com|"
82
            r"dnsfailover\.net|dnsrd\.com|dsmtp\.biz|dsmtp\.com|dubya\.biz|"
83
            r"dubya\.info|dubya\.net|dubya\.us|dumb1\.com|dynamic-dns\.net|"
84
            r"dynamicdns\.biz|dynssl\.com|edns\.biz|esmtp\.biz|ezua\.com|"
85
            r"faqserv\.com|fartit\.com|freeddns\.com|freetcp\.com|freewww\.biz|"
86
            r"freewww\.info|ftp1\.biz|ftpserver\.biz|gettrials\.com|"
87
            r"got-game\.org|gr8domain\.biz|gr8name\.biz|homingbeacon\.net|"
88
            r"https443\.net|https443\.org|ikwb\.com|instanthq\.com|iownyour\.biz|"
89
            r"iownyour\.org|isasecret\.com|itemdb\.com|itsaol\.com|jetos\.com|"
90
            r"jkub\.com|jungleheart\.com|justdied\.com|lflink\.com|lflinkup\.com|"
91
            r"lflinkup\.net|lflinkup\.org|longmusic\.com|mefound\.com|"
92
            r"misecure\.com|moneyhome\.biz|mrbasic\.com|mrbonus\.com|mrface\.com|"
93
            r"mrslove\.com|my03\.com|mydad\.info|myddns\.com|myftp\.info|"
94
            r"mylftv\.com|mymom\.info|mynetav\.com|mynetav\.net|mynetav\.org|"
95
            r"mynumber\.org|mypicture\.info|mypop3\.net|mypop3\.org|"
96
            r"mysecondarydns\.com|mywww\.biz|myz\.info|ninth\.biz|ns01\.biz|"
97
            r"ns01\.info|ns01\.us|ns02\.biz|ns02\.info|ns02\.us|ns1\.name|"
98
            r"ns2\.name|ns3\.name|ocry\.com|onedumb\.com|onmypc\.biz|"
99
            r"onmypc\.info|onmypc\.net|onmypc\.org|onmypc\.us|"
100
            r"organiccrap\.com|otzo\.com|ourhobby\.com|port25\.biz|"
101
            r"proxydns\.com|qhigh\.com|qpoe\.com|rebatesrule\.net|"
102
            r"sendsmtp\.com|serveuser\.com|serveusers\.com|sexidude\.com|"
103
            r"sexxxy\.biz|sixth\.biz|squirly\.info|ssl443\.org|ssmailer\.com|"
104
            r"toh\.info|toshibanetcam\.com|toythieves\.com|trickip\.net|"
105
            r"trickip\.org|vizvaz\.com|wikaba\.com|www1\.biz|"
106
            r"wwwhost\.biz|wwwhost\.us|x24hr\.com|xxuz\.com|xxxy\.biz|"
107
            r"xxxy\.info|ygto\.com|youdontcare\.com|yourtrap\.com|"
108
            r"zyns\.com|zzux\.com)(\.|)$": [
109
                (self.switch_down_if_dns_match, ("SOA", ["abuse.changeip.com."]))
110
            ]
111
        }
112

113
        super().__init__(status)
114

115
    @ExtraRuleHandlerBase.ensure_status_is_given
12✔
116
    @ExtraRuleHandlerBase.setup_status_before
12✔
117
    @ExtraRuleHandlerBase.setup_status_after
12✔
118
    def start(self) -> "DNSRulesHandler":
12✔
119
        """
120
        Process the check and handling of the current subject.
121
        """
122

123
        PyFunceble.facility.Logger.info(
124
            "Started to check %r against our subject switcher rules.",
125
            self.status.idna_subject,
126
        )
127

NEW
128
        for regex, rulesets in self.rulesets.items():
×
NEW
129
            if self.status.status_after_extra_rules:
×
NEW
130
                break
×
131

NEW
132
            if not self.regex_helper.set_regex(regex).match(
×
133
                self.status.netloc, return_match=False
134
            ):
NEW
135
                break
×
136

NEW
137
            for ruler, params in rulesets:
×
NEW
138
                if self.status.status_after_extra_rules:
×
NEW
139
                    break
×
140

NEW
141
                ruler(*params)
×
142

143
        PyFunceble.facility.Logger.info(
144
            "Finished to check %r against our subject switcher rules.",
145
            self.status.idna_subject,
146
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc