fix get_dns_dir which backtraces if regex is not found