Biofilm detachment caused by flushing can result in secondary contamination in drinking water distribution systems (DWDSs). To evaluate the impact of flushing on biofilm detachment, actual water supply pipes including ductile cast iron pipes (DCIPs), gray cast iron pipes (GCIPs), and stainless steel compound pipes (SSCPs) were used in this study. Real-time quantitative polymerase chain reaction and 454 pyrosequencing were used to quantify bacteria and analyse microbial community composition, respectively. The results showed that the pipe material greatly influences the resistance of a biofilm to flushing. Biofilms attached to DCIPs were able to resist quite strong flushing, while those attached to GCIPs and SSCPs were sensitive to flushing. Both flush-resistant and flush-sensitive bacteria were present in all the biofilms, but their frequency differed among the different metal pipes. Thus, the resistance to flushing of bacteria is related not only to the nature of the bacteria, but also to the pipe material. Although flushing can remove some of the biofilm and may be a good way to clean the DWDS, the shear stress needed to remove the biofilm differs among different pipe types. The results of this study provide technical support for the management and operation of DWDS.