The invention discloses a downhole wireless sensor network on-demand routing algorithm, and relates to the field of wireless sensor network energy-saving routing technologies. A method for determining a forwarding domain includes the steps that firstly, the angle of the forwarding domain is determined, and a set of neighbor nodes for forwarding an RREQ packet to a current node is set as S[n], wherein the number of nodes in S[n] is larger than or equal to one; when only one node exists in the set, the angle of the forwarding domain is 360 degrees, but a critical edge does not include a connecting line of the current node and the only one node, namely the current node can only be forwarded to nodes except the node in the set; when the number of the nodes in the set is more than one, the determined included angles between any two nodes and the current node are set as alpha, the included angles are compared, and the angle of the forwarding domain is beta, wherein beta is equal to 2 pi-max alpha; secondly, the critical edge of the forwarding domain is determined, wherein the critical edge is the connecting lines of the two nodes determining the angle alpha and the current node; the forwarding domain is determined by determining the angle and the critical edge of the forwarding domain, the forwarding range of the RREQ packet is controlled, and the RREQ packet is made to be only sent to the nodes which do not forward the packet to the current node.