In this paper, we study the minimum dominating set (MDS) problem and the minimum total dominating set MTDS) problem which have many applications in real world. We propose a new idea to compute approximate MDS and MTDS. Next, we give an upper bound on the size of MDS of a graph. We also present a distributed randomized algorithm that produces a (total) dominating subset of a given graph whose expected size equals the upper bound. Next, we give fast distributed algorithms for computing approximated solutions for the MDS and MTDS problems using our theoretical results. The MDS problem arises in diverse areas, for example in social networks, wireless networks, robotics, and etc. Most often, we need to compute MDS in a distributed or parallel model. So we implement our algorithm on massive networks and compare our results with the state of the art algorithms to show the efficiency of our proposed algorithms in practice. We also show how to extend our idea to propose algorithms for solving $k$-dominating set problem and set cover problem. Our algorithms can also handle the case where the network is dynamic or in the case where we have constraints in choosing the elements of MDS.