With a built-in AF motor and an aperture feeler for manual-focus lenses, the Nikon D5 works with all Nikon lenses made since 1977, and if AI-updated, all the way back to 1959!
Like most Nikon DSLRs, the D5 automatically corrects for any lateral color fringes in any lens, and for just about all Nikon lenses introduced in the past 20 years (any AF-D, AF-I, AF-S or G lens), also can automatically correct for lens distortion and corner light falloff. While it won't correct distortion with Nikon AI and AI-s manual focus lenses, it does provide full color Matrix metering, EXIF data and auto and manual exposure. Got a set of Nikon lenses from 39 years ago? You're already good to go with the D5; they'll look great.
The D5 works perfectly with every AF lens made since 1987,which means AF, AF-I, AF- and AF-S; G, E and D.
It also works great with AI and AI-S manual-focus lenses, and if you update the really old ones to AI, all Nikon's SLR lenses from as far back as 1959 work just fine with color matrix metering and manual and aperture-priority auto exposure and full EXIF data.
It doesn't work with Pronea (IX-NIKKOR), lenses for the ancient F3AF or with non-AI lenses, none of which fit properly.
The electronic rangefinder works with lenses as slow as f/5.6. There are also 9 selectable focus points that will work with lenses as slow as f/8.