We give a new second moment estimate for the Dedekind zeta function on the critical line. As an application, we improve the error term in the counting theorem for integral ideals of norm < x in a fixed number field K. This is joint work with Roger Baker.