In a peer-to-peer network, file replication technology is widely used to reduce hot spots and improve search performance. Most current file replication methods replicate files in all nodes or two endpoints on a client-server query path. However, these methods either have low effectiveness or come at a cost of high overhead. This paper presents an adaptive file replication method based on dynamic community (ARDC) that addresses the issue of where replicas should be placed. Simulation results demonstrate the efficiency and effectiveness of ARDC in comparison with other approaches. It dramatically reduces the overhead of file replication, and yields significant improvements on the efficiency and effectiveness of file replication in terms of query efficiency, replica hit rate and overloaded nodes reduction.