There are several reasons why you have this problem.
1. If you’re shooting in full auto mode, the camera decides what your aperture setting should be. Aperture directly determines the depth of field (the area in focus behind AND in front of the subject). As Mark says, switch to aperture mode (I think it’s marked “Av” on Nikon mode selector dials).
2. Even in Aperture mode, again, as Mark says, the widest aperture setting (lowest f/ number) on consumer zoom lenses narrows very quickly as you zoom. If yours is the 55-300 mm f/4.5-f/5.6, the widest aperture at the 55 mm end is f/4.5 (which is already rather slow). I suspect that f/5.6 is widest possible aperture from about 70 mm onwards. This is one of the reasons why pro lenses are much more expensive than consumer ones; max aperture remains constant throughout the focal length.
3. The sensor on your D5100 is smaller and closer to the lens than on a full-frame body. This affects focal length and DOF. This is one of the reasons why most compacts and mobile phone cameras offer no DOF possibilities.
It’s also worth noting that lens performance is least satisfactory at the widest aperture, which is when image distortion, vignetting, corner- and centre softness, chromatic aberrations and fringe highlights are the most noticeable. Prime lenses (non-zoom ones) tend to perform better than zooms, whilst consumer-grade zoom lenses are the worst offenders. Take a look at this post
, where the quality is seriously bad even on a full-frame camera with a supposedly “professional” grade prime lens.
Take heart, there is a solution. When I get my DOF wrong, a frequent occurrence, I now use a product from On One software called Focal Point 2.1. I think it can be purchased separately or as part of the surprisingly good Perfect Photo 7 suite. All its components work as plug-ins for Lightroom, Photoshop and Aperture or as standalone products. I use these, but there are surely other post-processing apps which can be downloaded for free as trial versions.