We investigate the effects of an electric current on the domain wall formed inside a cylindrical ferromagnetic nanopillar as a consequence of the pinning of the magnetization at its ends. We first present the results of three-dimensional and one-dimensional micromagnetic simulations and show that the system approaches a stationary equilibrium, where the domain wall is compressed in the direction of the electron flow and rotates around the nanopillar axis with constant frequency in the microwave frequency range. We obtain the dependence of the rotation frequency on the length of the nanopillar and on the magnitude of the applied current density. We then introduce a one dimensional analytical model and find a formula for the rotation frequency in two current regimes: a low current regime, where the frequency is linearly proportional to the current density and a high current regime, where the frequency is quadratically proportional to the current density. Good agreement is found with the results of the simulations. The system may have possible applications as a nano-sized microwave generator, which could operate without external magnetic fields and whose emission frequency could be controlled by a DC current.