The increasing penetration of distributed energy resources in distribution systems has brought a number of network management and operational challenges; reactive power variation has been identified as one of the dominant effects. Enormous growth in a variety of controllable devices that have complex control requirements are integrated in distribution networks. The operation modes of traditional centralized control are difficult to tackle these problems with central controller. When considering the non-linear multi-objective functions with discrete and continuous optimization variables, the proposed random gradient-free algorithm is employed to the optimal operation of controllable devices for reactive power optimization. This paper presents a distributed reactive power optimization algorithm that can obtain the global optimum solution based on random gradient-free algorithm for distribution network without requiring a central coordinator. By utilizing local measurements and local communications among capacitor banks and distributed generators (DGs), the proposed reactive power control strategy can realize the overall network voltage optimization and power loss minimization simultaneously. Simulation studies on the modified IEEE-69 bus distribution systems demonstrate the effectiveness and superiority of the proposed reactive power optimization strategy.