Esempio n. 1
0
    def build_single_domain_info(self, domain):
        _type = "A"
        cname = utils.get_cname(domain)
        if cname:
            _type = 'CNAME'
        ips = utils.get_ip(domain)
        if _type == "A":
            record = ips
        else:
            record = cname

        if not ips:
            return

        item = {"domain": domain, "type": _type, "record": record, "ips": ips}

        return modules.DomainInfo(**item)
Esempio n. 2
0
    def work(self, target):
        domain = target
        if hasattr(target, "domain"):
            domain = target.domain

        ips = utils.get_ip(domain)
        if not ips:
            return

        cnames = utils.get_cname(domain, False)

        info = {"domain": domain, "type": "A", "record": ips, "ips": ips}

        if cnames:
            info["type"] = 'CNAME'
            info["record"] = cnames

        self.domain_info_list.append(modules.DomainInfo(**info))