Computer Networks and the internet are essential to our daily lives and enterprises. DoS assaults threaten computer networks and network security. The world is evolving toward online businesses and services. This has increased network traffic over time. We need NIDS and DoS attack detection since there are more network risks and attacks. DoS attacks now threaten computer network servers. This threat must be detected automatically to protect corporate assets. Anomaly-based intrusion detection was developed because signature-based DoS attack and intrusion detection methods are inadequate. Many studies employ Machine Learning and Deep Learning to detect network anamolies. This article describes classification models constructed with the aid of machine learning algorithms. On the own dataset, this research was performed utilizing machine learning algorithms including K-Nearest Neighbor (KNN), Logistic Regression, and Random Forest. Random Forest outperforms other supervised machine learning algorithms, as demonstrated by this study's findings. It achieved an accuracy rate of 99.62% when nine features were selected utilizing Pearson's correlation coefficient method. The own dataset file (myNetworkGenerateTraffic.csv) which was captured through wireshark tool were utilized to accurately evaluate machine learning algorithms. We utilized the following performance metrics in this investigation: Accuracy, Precision, Recall, and F-1 score. In this paper, we examine how machine learning techniques can improve DoS attack prediction in network traffic to better analyze network traffic and help improve network security.