Two-component relativistic density functional theory (DFT) with the second-order Douglas–Kroll–Hess (DKH2) one-electron Hamiltonian was applied to the calculation of nuclear magnetic resonance (NMR) shielding constant. Large basis set dependence was observed in the shielding constant of Xe atom. The DKH2-DFT-calculated shielding constants of I and Xe in HI, I2, CuI, AgI, and XeF2 agree well with those obtained by the four-component relativistic theory and experiments. The Au NMR shielding constant in AuF is extremely more positive than in AuCl, AuBr, and AuI, as reported recently. This extremely positive shielding constant arises from the much larger Fermi contact (FC) term of AuF than in others. Interestingly, the absolute values of the paramagnetic and the FC terms are considerably larger in CuF and AuF than in others. The large paramagnetic term of AuF arises from the large d-components in the Au dπ –F pπ and Au sdσ–F pσ molecular orbitals (MOs). The large FC term in AuF arises from the small energy difference between the Au sdσ + F pσ and Au sdσ–F pσ MOs. The second-order magnetically relativistic effect, which is the effect of DKH2 magnetic operator, is important even in CuF. This effect considerably improves the overestimation of the spin-orbit effect calculated by the Breit–Pauli magnetic operator. © 2013 Wiley Periodicals, Inc.