Iron oxides are potential electrode materials for lithium-ion batteries because of their high theoretical capacities, low cost, rich resources, and their non-polluting properties. However, iron oxides demonstrate large volume expansion during the lithium intercalation process, resulting in the electrode material being crushed, which always results in poor cycle performance. In this paper, to solve the above problem, iron oxide/carbon nanocomposites with a hollow core–shell structure were designed. Firstly, an Fe2O3@polydopamine nanocomposite was prepared using an Fe2O3 nanocube and dopamine hydrochloride as precursors. Secondly, an Fe3O4@N-doped C composite was obtained by means of further carbonization treatment. Finally, Fe3O4@void@N-Doped C-x composites with core–shell structures with different void sizes were obtained by means of Fe3O4 etching. The effect of the etching time on the void size was studied. The electrochemical properties of the composites when used as lithium-ion battery materials were studied in more detail. The results showed that the sample that was obtained via etching for 5 h using 2 mol L−1 HCl solution at 30 °C demonstrated better electrochemical performance. The discharge capacity of the Fe3O4@void@N-Doped C-5 was able to reach up to 1222 mA g h−1 under 200 mA g−1 after 100 cycles.