The utilization of lithium–sulfur battery is hindered by various challenges, including the “shuttle effect”, limited sulfur utilization, and the sluggish conversion kinetics of lithium polysulfides (LiPSs). In the present work, a theoretical design for the viability of graphitic carbon nitride (g-C3N4) and phosphorus-doping graphitic carbon nitride substrates (P-g-C3N4) as promising host materials in a Li-S battery was conducted utilizing first-principles calculations. The PDOS shows that when the P atom is introduced, the 2p of the N atom is affected by the 2p orbital of the P atom, which increases the energy band of phosphorus-doping substrates. The energy bands of PC and Pi are 0.12 eV and 0.20 eV, respectively. When the lithium polysulfides are adsorbed on four substrates, the overall adsorption energy of PC is 48–77% higher than that of graphitic carbon nitride, in which the charge transfer of long-chain lithium polysulfides increase by more than 1.5-fold. It is found that there are powerful Li-N bonds between lithium polysulfides and P-g-C3N4 substrates. Compared with the graphitic carbon nitride monolayer, the anchoring effect of the LiPSs@P-g-C3N4 substrate is enhanced, which is beneficial for inhibiting the shuttle of high-order lithium polysulfides. Furthermore, the catalytic performance of the P-g-C3N4 substrate is assessed in terms of the S8 reduction pathway and the decomposition of Li2S; the decomposition energy barrier of the P-g-C3N4 substrate decrease by 10% to 18%. The calculated results show that P-g-C3N4 can promote the reduction of S8 molecules and Li-S bond cleavage within Li2S, thus improving the utilization of sulfur-active substances and the ability of rapid reaction kinetics. Therefore, the P-g-C3N4 substrates are a promising high-performance lithium-sulfur battery anchoring material.