There is a steep rise in the trend of the utility of Internet technology day by day. This tremendous increase ushers in a massive amount of data generated and handled. For apparent reasons, undivided attention is due for ensuring network security. An intrusion detection system plays a vital role in the field of the stated security. The proposed XGBoost–DNN model utilizes XGBoost technique for feature selection followed by deep neural network (DNN) for classification of network intrusion. The XGBoost–DNN model has three steps: normalization, feature selection, and classification. Adam optimizer is used for learning rate optimization during DNN training, and softmax classifier is applied for classification of network intrusions. The experiments were duly conducted on the benchmark NSL-KDD dataset and implemented using Tensor flow and python. The proposed model is validated using cross-validation and compared with existing shallow machine learning algorithms like logistic regression, SVM, and naive Bayes. The classification evaluation metrics such as accuracy, precision, recall, and F1-score are calculated and compared with the existing shallow methods. The proposed method outperformed over the existing shallow methods used for the dataset.