The monk who came up with the foundation of musical notation was Guido d'Arezzo and was born in the 990s. Before Guido's innovation the only way to distinguish between notes were lines pointing up or down and one didn't know for sure how far up or down to sing. So, Guido set an existing hymn to a new tune and arranged the melody like "Doe, a dear, a female deer." The first note was the lowest note of the scales, and each subsequent phrase began on note higher than the previous phrase. Then Guido used the first syllable of each phrase to name that note of the scale. He did all this to teach musically illiterate people how to sing so they could then lead worship themselves. The hymn's first phrase was Ut queant laxis. So Guido named the first note ut. The second phrase was resonare fibris. So he named the second note re. The hymn had six phrases, and so his charges learned to sing, "Ut, re, mi, fa, sol, la."
Back in those days the chants usually stayed within that six-note range, but a few went further, and so Guido allowed for a note below (which he designated by the Greek letter gamma). And thus the range of notes became known by their first two syllables, gamma + ut, or gamut. That explains why today when you "run the gamut," you move through the entire range of something.
But how did ut, re, mi become do, re, mi? Once the syllables became completely independent of their original hymn, some unknown Italian of the 17th century thought do sounded better than ut. I think he was right.
-adapted from Christian History & Biography, issue 93