Radiation-resistant bacteria are of great application potential in various fields, including bioindustry and bioremediation of radioactive waste. However, how radiation-resistant bacteria combat against invading phages is seldom addressed. Here, we present a series of crystal structures of a sensor and an effector of the cyclic oligonucleotide-based anti-phage signaling system (CBASS) from a radioresistant bacterium Deinococcus wulumuqiensis. We found that the sensor CD-NTase enzyme, DwCdnB, can bind all four ribonucleotides and synthesize a variety of cyclic di-nucleotides, including the novel second messenger 3'3'-cyclic di-CMP. Crystal structures of DwCdnB in complex with ATP and dATP provide structural explanations for specific recognition of ribonucleotides via metal coordination with ribose 2'-OH. Crystal structures of DwCdnB in complex with purine and/or pyrimidine nucleotides in the presence of Mg