<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_dns_cname(name, link=False):
 """ Looks for associated domain zone, nameservers and linked record name until no more linked record name was found for the given fully qualified record name or the CNAME lookup was disabled, and then returns the parameters as a tuple. """

        resolver = dns.resolver.Resolver()
        resolver.lifetime = 1
        domain = dns.resolver.zone_for_name(name, resolver=resolver).to_text(True)
        nameservers = Provider._get_nameservers(domain)
        cname = None
        links, max_links = 0, 5
        while link:
            if links >= max_links:
                LOGGER.error('Hetzner => Record %s has more than %d linked CNAME '
                             'records. Reduce the amount of CNAME links!',
                             name, max_links)
                raise AssertionError
            qname = cname if cname else name
            rrset = Provider._dns_lookup(qname, 'CNAME', nameservers)
            if rrset:
                links += 1
                cname = rrset[0].to_text()
                qdomain = dns.resolver.zone_for_name(cname, resolver=resolver).to_text(True)
                if domain != qdomain:
                    domain = qdomain
                    nameservers = Provider._get_nameservers(qdomain)
            else:
                link = False
        if cname:
            LOGGER.info('Hetzner => Record %s has CNAME %s', name, cname)
        return domain, nameservers, cname