Nowadays, the electrical power system has become a more complex, interconnected network that is expanding every day. Hence, the power system faces many problems such as increasing power losses, voltage deviation, line overloads, etc. The optimization of real and reactive power due to the installation of energy resources at appropriate buses can minimize the losses and improve the voltage profile, especially for congested networks. As a result, the optimal distributed generation allocation (ODGA) problem is considered a more proper tool for the processes of planning and operation of power systems due to the power grid changes expeditiously based on the type and penetration level of renewable energy sources (RESs). This paper modifies the AO using a quasi-oppositional-based learning operator to address this problem and reduce the burden on the primary grid, making the grid more resilient. To demonstrate the effectiveness of the MAO, the authors first test the algorithm performance on twenty-three competitions on evolutionary computation benchmark functions, considering different dimensions. In addition, the modified Aquila optimizer (MAO) is applied to tackle the optimal distributed generation allocation (ODGA) problem. The proposed ODGA methodology presented in this paper has a multi-objective function that comprises decreasing power loss and total voltage deviation in a distribution system while keeping the system operating and security restrictions in mind. Many publications investigated the effect of expanding the number of DGs, whereas others found out the influence of DG types. Here, this paper examines the effects of different types and capacities of DG units at the same time. The proposed approach is tested on the IEEE 33-bus in different cases with several multiple DG types, including multi-objectives. The obtained simulation results are compared to the Aquila optimizer, particle swarm optimization algorithm, and trader-inspired algorithm. According to the comparison, the suggested approach provides a superior solution for the ODGA problem with faster convergence in the DNs.