@classmethod
def canonical_record_name(cls, record_name, domain_name):
    """
        Strip the domain name from the record name, as Alwaysdata expects name ``foo.bar`` when
        adding the ``foo.bar.domain.com`` record.

        :param str record_name: the full record name
        :param str domain_name: the domain name managing the DNS record
        """
    return record_name[:record_name.rindex('.' + domain_name)]
