Mobile social network (MSN) offers a new perspective on mobile ad hoc communication since its routing principle is based on the human social relations. Although social‐based routing can improve routing efficiency considerably, obtaining such social information is difficult to be achieved. In information‐centric networking (ICN), content names reveal useful social information among users. In addition, each node stores and caches the received content to satisfy the forthcoming content requests in ICN due to in‐network caching. In this work, the proposed MSN routing relies on named data networking, which is a well‐known ICN paradigm. By the communities, which are detected based on users' interest preferences, an interest packet is delivered to the content provider based on the interest similarities among mobile users. Then, by communities, which are detected based on the nodes' encounter regularities, a data packet is returned to the interest requester according to the social relationships among mobile users. The content is cached at nodes according to both social and interest communities. Experiments and performance evaluations show that the proposed scheme has better message delivery ratio and lower network overhead than the other existing ones.