Due to instability of links in the network, the model of delay tolerant networks (DTNs) is often adopted in many emerging mobile applications. To organizations and individuals using these mobile applications, security and privacy are considered to be two of the most significant concerns. This research seeks to address anonymous communications in DTNs. While many different anonymous routing protocols have been proposed for ad hoc networks, to the best of our knowledge, only variants of onion-based routing have been tailored for DTNs. Since each type of anonymous routing protocol has its pros and cons, there is no single anonymous routing protocol for DTNs that can adapt to the different levels of security requirements. In this paper, we first design a set of anonymous routing protocols for DTNs, called anonymous Epidemic and zone-based anonymous routing, based on the original anonymous routing protocols for ad hoc networks. Then, we propose a framework of anonymous routing (FAR) for DTNs, which subsumes all the aforementioned protocols. By tuning its parameters, the proposed FAR is able to outperform onion-based, anonymous Epidemic, and zone-based routing. In addition, numerical analyses for the traceable rate, node anonymity, and path anonymity models are built. Extensive simulations using randomly generated graphs as well as real traces demonstrate that the proposed framework for DTNs successfully achieves its design goals.