Software defined networking (SDN) is a recent paradigm, providing various advantages over the traditional networks. This makes the SDN one of the key solutions for the fifth generation (5G) cellular system. Employing single centralized controller for the SDN networks introduces many problems concerning scalability, reliability and other system-related performance, especially for large scale networks. A single controller represents the bottleneck problem. Thus, employing distributed controllers will serve as a vital solution. The recent trend in the SDN networks is the deployment of distributed controllers; however, there are some issues related to this structure. The main problem with the distributed controllers is how to balance the load among these controllers. In this work, we will provide a dynamic clustering algorithm to balance the load among the distributed controllers in the SDN network. The system employs two levels of controllers; that is, distributed controllers and a master controller. A master controller manages and performs the clustering of the distributed controllers. The decision of clusters' reconstruction lies in the master controller's responsibility, based on the workload of the distributed controllers. The simulation results prove that the proposed algorithm is more efficient in balancing load among controllers, as compared to the existing static clustering techniques.