If your water supply has a high mineral content, one of the first places that stains will appear is the toilet. If you let them build up, they can stain the bowl and even cause poor flushing by building up inside the water ports under the rim of the bowl and restricting water flow. The film formed by the minerals, chiefly calcium and magnesium, is called scale, and you can dissolve this film with an acidic cleaner. Vinegar is usually strong enough to do the job, but if not, try a commercial descaler or muriatic acid.
The Vinegar Method
Flush the toilet, then wait for the bowl to refill and for the fill valve to stop. Pour 1/2 cup of distilled white vinegar in the tank and the same amount in the bowl. Let the vinegar sit there while you work on descaling the rim.
Fill a spray bottle with vinegar. Don't add water -- even though vinegar is strongly acidic, it won't hurt anything. You'll probably want to wear rubber gloves while you work on cleaning the rim and the top part of the bowl.
Spray vinegar on all the stained areas, including the underside of the rim. Pour some borax in a bowl and spray vinegar on it. Mix it with a plastic knife to make a paste. Spread the paste liberally around the underside of the rim and pack it into the holes.
Leave the paste on the toilet for several hours. Spray it periodically with vinegar to keep it wet. As long as the paste is wet, it will continue to dissolve scale.
Flush the toilet two or three times to completely clear vinegar from the tank. If the bowl is still stained, empty the bowl water into a bucket, using a sponge, and scrub the stains with the borax and vinegar paste. Flush when you're done.
Finish by washing the bowl with a commercial disinfectant cleaner. Scrub with a sponge or scrubber, then flush and rinse the areas you cleaned with clear water.
Using a Stronger Descaler
Put on gloves, goggles and protective clothing. Pour a 5-gallon bucket of water into the toilet to simulate a flush, and while the water level is still low, pour 12 ounces of muriatic acid or a commercial descaler into the bowl.
Swish the solution around the bowl and under the rim with a toilet brush. Do this carefully to avoid spilling any of the liquid on the floor. Repeat multiple times over a period of about 30 minutes.
Put the toilet lid down and leave the solution in the toilet for two hours. When you come back, swish it under the rim a few more times.
Flush the toilet several times to clear the bowl when you're done.