Remove duplicat code; a, aaaa and cname are handled the same.