Spin-ice physics in cadmium cyanide