As the number of Internet of Things (IoT) devices continues to grow, these devices become increasingly vulnerable to Distributed Denial of Service (DDoS) attacks. However, their limited computational capacity makes it difficult to implement conventional security mechanisms. This study proposes a model for detecting DDoS attacks using Random Forest, trained using the CICIoT2023 dataset, which consists of 46 flow-based features collected from 105 real-world IoT devices. The preprocessing stage includes binary classification, normalization using StandardScaler, and handling class imbalance through a combination of 1:10 undersampling and class weighting. Evaluation on 1,154,684 test samples shows excellent performance, achieving 99.99% accuracy, 100% precision, 99.99% recall, and 99.99% F1-score. To ensure reliability, six validation checks are conducted, including overfitting analysis, cross-validation. The results confirm that the model can generalize well beyond the training data. Most attack types are detected perfectly, although application-layer attacks such as DDoS-SlowLoris remain more challenging. Overall, Random Forest proves to be an effective and relatively lightweight approach for DDoS detection in IoT environments.Keywords: DDoS; Random Forest; IoT; CICIoT2023; Machine LearningAbstrakPertumbuhan jumlah perangkat IoT menyebabkan peningkatan risiko terhadap berbagai ancaman keamanan terhadap serangan Distributed Denial of Service (DDoS). Namun, keterbatasan kapasitas komputasi pada perangkat IoT menyulitkan penerapan mekanisme keamanan konvensional. Penelitian ini mengusulkan model deteksi DDoS berbasis Random Forest yang dilatih menggunakan dataset CICIoT2023, yang terdiri dari 46 fitur berbasis flow yang dikumpulkan dari 105 perangkat IoT nyata. Tahap preprocessing meliputi klasifikasi biner, normalisasi menggunakan StandardScaler, serta penanganan ketidakseimbangan kelas melalui kombinasi undersampling (1:10) dan class weighting. Hasil evaluasi pada 1.154.684 data uji menunjukkan performa yang sangat tinggi, dengan accuracy sebesar 99,99%, precision 100%, recall 99,99%, dan F1-score 99,99%. Untuk memastikan keandalan model, dilakukan enam pengujian validasi, termasuk analisis overfitting, cross-validation. Hasil penelitian mengonfirmasi bahwa model mampu melakukan generalisasi dengan baik terhadap data di luar data pelatihan. Sebagian besar jenis serangan berhasil dideteksi secara sempurna, meskipun serangan pada lapisan aplikasi seperti DDoS-SlowLoris masih menjadi tantangan. Secara keseluruhan, Random Forest terbukti sebagai pendekatan yang efektif dan relatif ringan untuk deteksi DDoS pada lingkungan IoT Kata kunci: DDoS; Random Forest; IoT; CICIoT2023; Machine Learning