Recently, the American Academy of Dermatology (AAD) issued a position paper on the subject. They reviewed the scientific literature on the subject and concluded that
the public (should) obtain vitamin D from nutritional sources and dietary supplements, and not from unprotected exposure to ultraviolet (UV) radiation from the sun or indoor tanning devices, as UV radiation is a known risk factor for the development of skin cancer.
They recommend that the public use the National Academy of Sciences guidelines for Vitamin D for the proper level of intake. This is 200 IU for adults up to 50 years and 400 IU for adults 51-70. For the lucky ones who last even longer, you should be taking 600 IU daily.