Context : Dynamical studies of prestellar cores search for small velocity differences between different tracers. The highest radiation frequency precision is therefore required for each of these species. Aims : We want to adjust the frequency of the first three rotational transitions of N2H+ and N2D+ and extrapolate to the next three transitions. Methods : N2H+ and N2D+ are compared to NH3 the frequency of which is more accurately known and which has the advantage to be spatially coexistent with N2H+ and N2D+ in dark cloud cores. With lines among the narrowests, and N2H+ and NH3 emitting region among the largests, L183 is a good candidate to compare these species. Results : A correction of ~10 kHz for the N2H+ (J:1-0) transition has been found (~0.03 km/s) and similar corrections, from a few m/s up to ~0.05 km/s are reported for the other transitions (N2H+ J:3-2 and N2D+ J:1-0, J:2-1, and J:3-2) compared to previous astronomical determinations. Einstein spontaneous decay coefficients (Aul) are included.