How to prevent or detect counterfeit parts from distributors and manufacturers?
Larger distributors such as Digi-Key, Mouser, Arrow and Avnet will offer several certifications that authorizes legitimate distribution of Manufacturers goods. Typically, these certifications can be located on the homepage of the distributors website. 

Some "No Name" distributors try to fool customers by providing certifications that appeal to the eye; however, are limited to the counterfeit prone countries (China and India are most notorious.)

When in doubt, always go to the larger franchised distributors (they typically have everything anyways.) Below is Digi-Keys Authorization. Visit their website to see more thorough descriptions.