Nikon has a new firmware update, version 1.009, that performs in-camera correction for barrel and pincushion lens distortion during shooting and editing. The update applies to these cameras: D4, D90. D600, D800, D800E, D3100, D5000, D5100, D5200, D7000, and D7100.
I just updated my cameras. It was the easiest, quickest update ever, with very clear instructions from the Nikon installation site.
You can download the update here for MAC and for WINDOWS
You can read the instructions for this firmware here: for MAC and for WINDOWS.