With the emerging growth of cloud computing technology and on-demand services, users can access cloud services and software freely and applications based on the "pay-as-you go" concept. This innovation reduced service costs and made them cheaper with high reliability. One of the most significant characteristics of the cloud concept is on-demand services. One can access the applications of cloud computing at any time at a much lower cost. In addition to providing cloud users with much-needed services, the cloud also gets rid of security concerns which are not tolerated by the cloud. One of the most security problems in the cloud environment is Distributed Denial of Service (DDoS) attack that are responsible for overloading the cloud servers. This paper highlights a prevention technique (CS-ANN) which detect the DDoS attack and makes the server side more sensitive by integrating a Cuckoo Search (CS) approach with the Artificial Neural Network (ANN) approach. The cloud user features, along with the attacker features, are optimized using CS as a natureinspired approach. Later on, these optimized features are passed to the ANN structure. The trained features are stored in the database and used during testing process to match the test features with the trained features and hence provide results in terms of attacker and normal cloud users. The test results of CS-ANN show a True Positive Rate (TPR), False Positive Rate (FPR) and detection accuracy of 0.99, 0.0105 and 0.9865% respectively. The proposed approach outperforms in contrast to the other two state-of-the-art techniques.