Distributed Denial of Service (DDoS) attacks have evolved into sophisticated threats against digital infrastructure. This research investigates Convolutional Neural Networks (CNNs) for DDoS detection using the CIC-IDS2017 dataset. A CNN model was developed, leveraging convolutional and pooling layers for hierarchical feature extraction. Preprocessing ensured dataset consistency and generalization. The model achieved 99.978% test accuracy, demonstrating proficiency in recognizing DDoS patterns. Comparatively, a Deep Neural Network (DNN) benchmark obtained 99.9512% accuracy, indicating CNNs superiority. However, CNN training time was longer. While results highlight deep learning's potential against DDoS attacks, optimizations for real-time deployment warrant exploration. This empirical evaluation and comparative analysis enriches the discourse on utilizing machine learning for robust cybersecurity.