Dominating sets of the comaximal and ideal-based zero-divisor graphs of the commutative rings