def delete(zone, name, rdtype=None, data=None, nameserver='127.0.0.1',
           **kwargs):
    '''
    Delete a DNS record.

    CLI Example:

    .. code-block:: bash

        salt ns1 ddns.delete example.com host1 A
    '''
    name = str(name)
    fqdn = '{0}.{1}'.format(name, zone)
    request = dns.message.make_query(fqdn, (rdtype or 'ANY'))

    answer = dns.query.udp(request, nameserver)
    if not answer.answer:
        return None

    keyring = _get_keyring(_config('keyfile', **kwargs))
    keyname = _config('keyname', **kwargs)
    keyalgorithm = _config('keyalgorithm',
                           **kwargs) or 'HMAC-MD5.SIG-ALG.REG.INT'

    dns_update = dns.update.Update(zone, keyring=keyring, keyname=keyname,
                                   keyalgorithm=keyalgorithm)

    if rdtype:
        rdtype = dns.rdatatype.from_text(rdtype)
        if data:
            rdata = dns.rdata.from_text(dns.rdataclass.IN, rdtype, data)
            dns_update.delete(name, rdata)
        else:
            dns_update.delete(name, rdtype)
    else:
        dns_update.delete(name)

    answer = dns.query.udp(dns_update, nameserver)
    if answer.rcode() > 0:
        return False
    return True
dataset/ETHPy150Open saltstack/salt/salt/modules/ddns.py/delete/original