In the application layer multicast (ALM), clustering nearby nodes can effectively improve the multicast performance. However, it is difficult for the ALM solution to quickly and accurately position the newcomer, because group members have no direct knowledge of underlying network topology. Additionally, ALM delivery trees with different performances are built when group members join the group in different join sequences. To alleviate the above problems, this paper proposes a distance-heuristic tree building protocol (called DHTB). DHTB uses our proposed distance-constrained cluster model and close-member-first-receive (CF) rule. In the model, most nearby nodes are grouped into some distance-constrained clusters, with little cluster organization and maintenance overhead. The CF rule arranges or rearranges the locations of group members according to related distances, and effectively positions the newcomer with the help of on-demand landmarks. Both the distance-constrained cluster model and CF rule are distance-heuristic. Therefore DHTB can alleviate the join sequence problem, and build the ALM tree with desirable performance.