Current methods for bearing fault diagnosis often fall short in addressing data privacy concerns and typically rely on one-to-one transfer strategies, which are inadequate for achieving knowledge transfer in distributed environments. To address this issue, a distributed fault diagnosis method for rolling bearings based on federated transfer learning is proposed. This method ensures data privacy while integrating fault knowledge from multiple domains, thereby enabling more efficient knowledge transfer. Specifically, a domain adversarial neural network (DANN) is introduced as the base model within the federated learning framework. Additionally, maximum mean discrepancy (MMD) is incorporated into the DANN to enhance the transfer of fault knowledge. Finally, a dynamic weighting parameter update method based on MMD is designed to evaluate the feature discrepancies between source and target domains, thereby updating the parameters of the federated framework and achieving global model aggregation. Experimental results on two bearing datasets demonstrate that the proposed method excels in both distribution alignment and fault diagnosis.