If you want to adapt an M42 lens to Nikon be careful. With an F-mount camera, you can potentially cause damage with some M42 screw mount lenses.
With some lenses, the rear element can extend back into the mirror box of a camera. A handful of M42 lenses can extend far enough back and hit the mirror.
Flange Focal Distance
The flange focal distance is how far the sensor or film plane is away from the camera mount. This distance is large in SLR cameras because of the mirror.
F-mount lenses need a flange distance of 46.50mm. That is larger than the 45.46mm needed for M42 lenses.
The larger distance means that M42 lenses will not focus to infinity when adapted to the F-mount. Think of it as a small extension tube.
Adapters with Glass
To allow M42 lenses to focus to infinity, there are adapters with glass. Unfortunately, they have problems.
Reduced Image Quality
Cheap adapters have cheap optics. Images taken will be much softer than those taken without the corrective objective.
I would not recommend buying an adapter with glass.
Rear Elements Can Hit the Glass
Now you get to worry about hitting the glass in the adapter. This situation is much more likely to occur than your mirror being hit.
Scratches on the front element of a lens might not be noticeable in images. Messing up the rear element of a lens will degrade images.
Adapters without Glass
Focusing to infinity is not needed with macro photography or when using M42 accessories.
An M42 macro lens, extension tubes, or bellows will work. The extension from a lens adapter is easy to account for.
Another benefit is that M42 extension tubes and bellows are less expensive than their Nikon alternatives.
The main thing I use my Fotodiox M42 adapter for is to hold an M42 to RMS adapter. This allows me to mount microscope objectives to my Nikon PB-4 bellows.
I found that the adapter sandwich was cheaper than tracking down a Nikon to RMS adapter.
Which Adapter to Buy?
I have a few adapters for Nikon, but many more for Sony E, Fuji, Canon EOS, and Micro Four Thirds. The only adapters I have had a problem with are the ones that are unbranded.
My suggestion would be to look for a Fotodiox or Fotasy from wherever you like to buy your photo equipment. I bought mine from eBay, but Amazon, Adorama, B&H, KEH, and other places will have them.