Melanonychia is produced by an excess of melanin causing the nails to take on a blackish color.
A dermatologist is a doctor who specializes in diseases of the skin, hair, nails and mucous membranes.
Remember that for the proper selection of health professional that treats melanonychia you must consider the nature, severity and symptoms you are presenting.