A mobile ad hoc network is a collection of mobiles, autonomous nodes that communicate in a cooperative manner over a wireless channel without any fixed infrastructure, nor built‐in security. As such, this type of network is vulnerable to different types of attacks such as blackhole and wormhole attacks. A blackhole attack is a type of attack where the malicious node (so‐called blackhole node) can attract all the data packets by using a forged route reply packet to falsely claim that it has a shortest route to the destination, thereby dropping all the data packets that it receives. In this paper, an improved version of a dynamic source routing (DSR) protocol (so‐called detecting blackhole attack based on DSR (DBA‐DSR)) is proposed to combat against blackhole attacks in mobile ad hoc networks. Unlike other solutions, which adopt a reactive approach in which blackhole nodes are identified only after the attack has been carried out on the network, our DBA‐DSR scheme detects and isolates the blackhole nodes prior to the actual routing process. This is achieved by using fake route request packets. Simulation results are provided, demonstrating the superiority of DBA‐DSR over DSR in terms of network throughput, packet delivery ratio, and routing overhead, chosen as performance metrics, when blackhole nodes are present in the network. Copyright © 2013 John Wiley & Sons, Ltd.