Look carefully at the ID name plate on the lens, if it says AF-S you can use it on any current D series body.
If it is AF-D, you will need a body with a build in screw drive focus motor, D90, D300, D300S, D7000/7100. The mid leve DX body like the D5100/5200/5300 series do not have the build in screw focus motor.