Removing the DC component in the frequency domain is not trivial, and generally not recommended. Although ideally all the DC content should be at the 0-th bin of your Discrete Fourier Transform, in practice the DC content tends to "leak" to nearby bins due to spectral leakage. The amount of leakage will depend on a bunch of factors such as the magnitude of your DC component, DFT size, amount of zero-padding, and chosen windowing function. This leakage may interfere with the estimation of your nearby lower frequencies, which may or may not be a significant problem for your signal analysis.
In general, it is more efficient, more controllable and more reproducible to perform a DC removal in the time domain, as you described in your question, or even a linear trend removal. Some packages/languages already contain pre-built functions to perform this task, such as SciPy/Python. Another option is to high-pass filter your signal at a very low frequency, e.g. 1 Hz or lower, as suggested in other answers.
See here (chapter 11) for more details on this issue.