A water quality model for the water distribution network of a town MD was established with EPANET2. Water ages of the nodes were analyzed to evaluate the water quality condition of the water supply network through the simulation. Then an optimal scheduling model based on the comprehensive node water age index was proposed and solved with genetic algorithm method. The results of application the optimal model to a county water distribution network indicate that the hydraulic optimal scheduling is able to improve the comprehensive water node age, especially for the nodes with big water demand. While for nodes with relatively small flow located at the ends of water supply network, water distribution system flushing is still necessary to ensure the .tap water quality at the end of the network.