Domestic hot water (DHW) represents an important part of the total energy consumption of residential buildings. DHW demand typically exhibits a highly stochastic behavior strongly linked to occupant behavior. A neural network was trained to predict the future DHW demand with the help of two years of data from a reference 40 unit residential building in Quebec City, Canada. The neural network provided better predictions than a static hourly demand schedule. Then, the neural network was used by a model predictive control (MPC) strategy that has been developed to control the water flow rate supplied to the heater as well as its output temperature setpoint. Simulations of a hot water system were performed in TRNSYS, a software used to simulate transient systems such as buildings, with a controller using the MPC and an adaptation of the rule-based controllers in the reference building. Results show potential energy savings when using the MPC which depends on the hot water system design. Moreover, the energy consumption of the heater using the predictive controller is more uniformly distributed in time than with the rule-based strategy.