For a distance matrix D(G), its inertia is the triple of integers (n+(D),n0(D),n−(D)), where n+(D), n0(D), n−(D) denote the number of positive, 0, negative eigenvalues of D(G), respectively. The D-energy is the sum of the absolute eigenvalues of D(G). In this paper, we first study the inertia of distance matrices of complete k-partite graphs; Then, as applications, we not only prove a conjecture proposed by Caporossi et al. (2009) in [5] in a different way from Stevanović et al. (2013) [11] but also obtain the formula of the D-energy of the remaining complete k-partite graphs. At last, we obtain the graphs with the maximum (resp. minimum) D-energy among all the complete k-partite graphs with n vertices.