The DNA segments that carry genetic information are called genes, but other DNA sequences have structural purposes, or are involved in regulating the expression of genetic information.
The major function of DNA is to encode the sequence of amino acid residues in proteins, using the genetic code. To read the genetic code, cells make a copy of a stretch of DNA in the nucleic acid RNA. These RNA copies can then be used to direct protein synthesis, but they can also be used directly as parts of ribosomes or spliceosomes.