We present a novel method for the calculation of the static and electronic dielectric tensor of polar insulating crystals based on concepts from the modern theory of dielectric polarization. As an application, we present the first ab initio calculation of the dielectric constants in the wurtzite III-V nitrides AlN, GaN, and InN.