In the last decade, the popularity of UAVs, colloquially known as drones, has increased tremendously. Nowadays, drones are used in a wide range of use-cases, such as precision agriculture, surveillance, and photography. Many of these use-cases can be made more efficient if multiple UAVs are used cooperatively (i.e., in a swarm). To achieve this, communication between the UAVs is paramount. To ensure communication, many works rely on the existing infrastructure (e.g., 4G). However, in many rural areas, this infrastructure does not exist. In those cases, an ad hoc (Wi-Fi) network is the most adequate alternative. Yet, due to the limited communication range of Wi-Fi, it is not possible to let UAVs in a swarm to communicate over a long distance. To solve this issue a relay approach is necessary. Despite general solutions to relay messages between (mobile) nodes already exist, many UAV swarms rely on master–slave communication. Thus, a specific solution for this type of communication might be more efficient. Hence, in this work, we propose a strategy to efficiently relay messages for UAV swarms adopting the master–slave communication paradigm. Our approach seeks to introduce a very small message overhead to avoid congestion of the network, and to provide more bandwidth for the actual applications of the UAV swarm. We tested our approach using a realistic UAV simulator called ArduSim. Our results show that our approach is capable of detecting all the nodes in the network within a few seconds. Furthermore, we applied our message relay approach on an existing swarm application (where a swarm of UAVs had to follow a mission), and our results show that, now, the communication range of the UAVs can be much larger, without impacting other aspects of the mission (such as flight time).