The fundamental band gaps of liquid water and hexagonal ice are calculated through advanced electronic-structure methods. We compare specifically the performance of state-of-the-art GW calculations with nonempirical hybrid functionals. For the latter, we fix the free parameters either through the dielectric response of the material or through enforcing Koopmans' condition to localized states. The various approaches yield consistent band gaps, in good agreement with available experimental references. Furthermore, we discuss the critical aspects of each approach that underlie the band-gap predictions.