We study nucleon-nucleon (N N ) scattering by applying the N/D method in chiral perturbation theory up to next-to-next-to-leading (NNLO) order in the calculation of the imaginary part of the N N partial-wave amplitudes along the left-hand-cut, which is the dynamical input for this approach. A quite good reproduction of the Nijmegen partial-wave analysis phase shifts and mixing angles is obtained, which implies a steady improvement in the accurateness achieved by increasing the chiral order in the calculation of the dynamical input. A power counting for the subtraction constants is established, which is appropriate for those subtractions attached to both the left-and right-hand cuts. We discuss that it is not necessary to modify the N N chiral potential at NNLO to agree with data, but instead one should perform the iteration of two-nucleon intermediate states to finally achieve analytic and unitarity N N partial-wave amplitudes in a well-defined way. We also confirm at NNLO the long-range correlations between the N N S-wave effective ranges and scattering lengths, when employing only once-subtracted dispersion relations, that holds up to around 10% when compared with experimental values.