The user equipment and directory server stay in the state of asymmetric information in anonymous networks, so that it is hard to coordinate information leakage prevention and information sharing when we explore the routing addressing technology. The severe security risk faced by existing anonymous networks, such as Tor and I2P, is the leakage of privacy information of routing nodes. This paper tries to resolve this problem and proposes a novel secure querying scheme of the routing table (SQRT) based on oblivious transfer, which can effectively ensure that both user equipment and directory server faithfully follow the routing querying protocol and protect the privacy information of both parties to the greatest extent. The SQRT scheme can realize that the directory server cannot only send the required routing nodes to the user equipment, but can also ensure that the directory server cannot know the exact routing nodes received by the user equipment and protect the information of other routing nodes in the directory server from disclosure. Security analysis shows that in the scenario where the directory server and user equipment are semi-honest, respectively, the SQRT scheme can ensure the privacy of both directory server and user equipment. The experimental simulation results show that compared with existing schemes, the SQRT scheme has obvious performance advantages in terms of the degree of anonymity, protocol running time, and communication traffic.