refactored get_dnlist to get_dn