A search is presented for resonances decaying to a Z boson and a photon. The analysis is based on data from proton-proton collisions at a center-of-mass energy of 13 TeV, corresponding to an integrated luminosity of 35.9 fb(-1), and collected with the CMS detector at the LHC in 2016. Two decay modes of the Z boson are investigated. In the leptonic channels, the Z boson candidates are reconstructed using electron or muon pairs. In the hadronic channels, they are identified using a large-radius jet, containing either light-quark or b quark decay products of the Z boson, via jet substructure and advanced b quark tagging techniques. The results from these channels are combined and interpreted in terms of upper limits on the product of the production cross section and the branching fraction to Z gamma for narrow and broad spin-0 resonances with masses between 0.35 and 4.0 TeV, providing thereby the most stringent limits on such resonances.