Data fusion can be distributed into network and executed on network nodes, to reduce data from redundant sensor nodes, to fuse the information from complementary sensor nodes and to get the complete view from cooperative nodes. Consequently only the inference of interest is sent to end user. This distributed data fusion can significantly reduce the data transmission cost and there is no need for a powerful centralized node to process the collected information. However, to achieve the advantages of distributed data fusion and better utilization of network resources, each fusion function needs to be performed at particular network node for minimizing energy cost of data fusion application, both data transmission cost and computation cost. In this paper, distributed data fusion routing (D2F) is proposed, which is designed for deploying distributed data fusion application in wireless sensor networks. D2F can find the optimal route path and fusion placements for a given data fusion tree, which obtains the optimal energy consumption for in-network data fusion. D2F can also handle different link failures and maintain the optimality of energy cost of data fusion by adapting to the dynamic change of network.