Yes, tomatoes belong to the nightshade family.
Tomatoes are members of the Solanaceae, or nightshade family. Their relatives include potatoes, eggplants, bell peppers, chile peppers, tomatillos and goji berries, along with non-food plants like tobacco and petunias.
The family's name makes some people nervous because it also includes deadly nightshade, or belladonna, a toxic plant. Many nightshades produce natural defensive compounds called alkaloids. In tomatoes, the main one, tomatine, is concentrated in the leaves, stems and green unripe fruit. As tomatoes ripen, the level drops to very little.
This family connection is partly why tomatoes were viewed with suspicion in parts of Europe when they first arrived from the Americas in the 1500s. Many people grew them as ornamental plants before they became a kitchen staple, especially in Italy and Spain.
Ripe tomatoes are safe for nearly everyone. A small number of people avoid nightshades for personal health reasons, but there's no strong evidence they cause problems for most people.