PAL2NAL is a program that converts a multiple sequence alignment of
proteins and the corresponding DNA (or mRNA) sequences into a codon-
based DNA alignment. The program automatically assigns the corresponding
codon sequence even if the input DNA sequence has mismatches with the
input protein sequence, or contains UTRs,polyA tails. It can also deal
with frame shifts in the input alignment, which is suitable for the
analysis of pseudogenes.

The resulting codon-based DNA alignment can further be subjected to the
calculation of synonymous (Ks) and non-synonymous (Ka) substitution
rates.

If you use PAL2NAL, please cite the following paper:

Mikita Suyama, David Torrents, and Peer Bork (2006)
PAL2NAL: robust conversion of protein sequence alignment into the
corresponding codon alignments. Nucleic Acids Res. 34:W609-W612.