The Internet of Things (IoT) represents a rapidly advancing technological framework enabling the global interconnection and interaction of millions of devices. With the growth of IoT networks, security has become a crucial concern due to the frequent exchange of sensitive data. Among IoT services, secure communication between devices is particularly vital. MQTT, or Message Queue Telemetry Transport, is a messaging protocol that operates on a publish/subscribe service model and is notably vulnerable to Denial of Service (DoS) attacks, which severely disrupt its normal functioning. DoS attacks are particularly challenging as they lead to network performance degradation and are difficult to detect. This paper introduces a lightweight fuzzy rule-based detection system, LFDNI-DA, designed to mitigate DoS attacks within MQTT-based IoT networks. The approach leverages a fuzzy inference engine (FIE) to identify various network intrusions and compromised devices, and it applies FIE in message-forwarding behavior analysis. LFDNI-DA utilizes aggregate logging from legitimate nodes to select trusted nodes for message forwarding. Key performance metrics such as false positive rate, true negative rate, intrusion detection accuracy, detection efficiency, and precision rate are evaluated using the Cooja network simulator. Simulation results reveal that the proposed LFDNI-DA system can detect and prevent DoS attacks with a 99.9% accuracy rate and achieves a 94% average precision in identifying and differentiating among various DoS attack types. The F1-score, recall, and precision rates for LFDNI-DA stand at 97.62%, 93.28%, and 98.29%, respectively, highlighting its effectiveness in enhancing IoT network security.