The function of DNA in a cell is to code the way proteins turn genes on or off. the function of DNA is to make the proteins. DNA is the foundation of life. It's a complex molecule made up of four types of bases, cross connected like a staircase, and twisted into a spiral.