Abstract Reliable fault diagnosis of rotating machinery is essential for stable and safe operation of industrial systems. However, challenges such as significant data distribution discrepancies and intra-domain shifts caused by latent noise in the unlabeled target domain pose major barriers to the practical application of deep learning based fault diagnosis. These issues are particularly evident for samples near the decision boundary. Such samples often exhibit higher uncertainty and reduce the separability of the target feature space. To address these challenges, this paper proposes an uncertainty-aware domain adaptation framework for bearing fault diagnosis. First, we propose a perturbation-based module to measure sample uncertainty. It jointly uses perturbation sensitivity and historical information, enabling stable and reliable uncertainty estimation. Second, all domain alignment designs are adaptively guided by quantifying and exploiting sample uncertainty throughout training. For inter-domain alignment, we introduce an uncertainty-weighted discrepancy measure to improve the accuracy of cross-domain comparison. For the often-neglected intra-domain modeling, we further propose an uncertainty ranking based dual-matrix mechanism to improve pseudo-label reliability and preserve the geometric structure of the target domain. Experiments on a public dataset and an experimental bearing dataset demonstrate that the proposed method consistently outperforms state-of-the-art fault diagnosis methods in terms of diagnostic accuracy and reduce sample uncertainty.