Detecting Distributed Denial-of-Service (DDoS) attacks remains a pivotal area of research, with machine learning (ML) methods playing a central role in identifying these attacks through flow-based characteristics. This study explored advanced ML models, ranging from traditional algorithms such as Logistic Regression, Decision Trees, Random Forest, and Gaussian Naive Bayes to state-of-the-art deep learning architectures, for anomaly-based DDoS detection systems (DDoSDS). Leveraging the CICIDS2017 dataset, we demonstrated the effectiveness of our approach in capturing complex attack patterns. We primarily focused on employing feature selection strategies, including Univariate Feature Selection (UFS) and Recursive Feature Elimination (RFE), to reduce dimensionality from 70 to 10 with minimal effect on model performance. These techniques not only enhanced detection accuracy to an impressive 99.99% but also significantly reduced false positives and false negatives, achieving a remarkable 0.0% in both metrics. This advancement offers a robust and reliable shield against evolving security threats, highlighting the transformative potential of ML in safeguarding network systems from DDoS attacks.