Your hamstring, located in the back of your thigh, isn't actually a single muscle but rather a group of three muscles: the biceps femoris, semitendinosus and semimembranosus. All three muscles work to flex your knee and extend, or straighten, your hip. The two versions of the deadlift work your hamstrings, glutes, erector spinae and quads.
There are two primary varieties of the deadlift exercise: bent-leg deadlifts and straight-leg deadlifts. While bent leg-deadlifts do work your hamstrings along with your quads, adductors and glutes, straight-leg deadlifts--also known as Romanian deadlifts--take your quads out of the equation. This allows your hamstrings to take on more of the lifting load.
To do a straight-leg deadlift, stand square with your feet between hip- and shoulder-width apart. Grasp a barbell or dumbbells with an overhand grip. Keep your back straight as you thrust your hips back, letting your torso hinge downward. The weights should stay close to your thighs, sliding down your legs until either they reach a point just below your kneecaps or you feel a mild stretch in your hamstrings, whichever comes first. Although called a straight-leg deadlift, a slight bending of the knees at the bottom of the repetition is permissible. The legs are straight at the starting (standing position) oof each repetition.
You should practice the deadlift movement without added weight until you develop proper form. Once you've got a handle on correct technique, add extra weight by either holding a barbell in front of your body or holding a dumbbell in each hand. If you use dumbbells, hold them in front of your body, palms facing back, as if they were connected by an invisible barbell.
The straight leg deadlift is an ideal hamstring exercise because it trains the muscle through its full range of motion. But you should be careful not to overdo it, as lowering the weight past the point of feeling a mild stretch in your hamstrings can lead to injury. If you have a particularly inflexible lower back--something that often goes hand-in-hand with tight hamstrings--you may have to limit your range of motion until you develop sufficient lower-back flexibility to let you reach the point of mild stretch in your hamstrings.
According to ExRX.net, your hamstrings should be at least 56 to 80 percent as strong as your quadriceps, depending on your demographics. Hamstring weakness and inflexibility is very common in modern Western society, perhaps due in part to the habit of not sitting on the ground or bending over regularly, both activities that stretch and strengthen the hamstrings.