Internet of Things (IoT) is a relatively new concept in computer science that connects devices with constrained resources to insecure internet through different technologies. IoT’s fundamental components, including the wireless sensor networks and the internet, have an unsecured foundation that leads to DoS attacks, namely, sinkhole, blackhole, and grey hole attacks. To maintain the integrity and security of the IoT networks, many researchers implemented distributed ledgers in IoT environments. In this paper, we designed a hybrid framework between blockchain and IoT devices; the aim is to secure data transmission in IoT networks using blockchain technology to defend against DoS attacks. Our framework is called HFSDT-IoT. The method proposed in this paper consists of two phases to maintain security in the IoT. In the first phase, both a list of attackers and a safe list based on the Ethereum Proof-of-Stake (PoS) protocol is used, which complemented by utilizing the proposed IDSs Intrusion Detection System to discover malicious things. In the second phase, to decrease the obstacles in facilitating communication between blockchains, the inter-blockchain communication model creates a network of multiple blockchains with secp256k1 encryption used for heterogeneous blockchains. The experimental results of simulated scenarios show the HFSDT-IoT strategy can achieve better results when DoS attacks were launched compared to other blockchain-based methods, namely Bubble of Trust and Credibility Verification Method.