Pollux is considered as an archetype of a giant star hosting a planet: its radial velocity (RV) presents sinusoidal variations with a period of about 590 d, which have been stable for more than 25 years. Using ESPaDOnS and Narval we have detected a weak (sub-gauss) magnetic field at the surface of Pollux and followed up its variations with Narval during 4.25 years, i.e. more than for two periods of the RV variations. The longitudinal magnetic field is found to vary with a sinusoidal behaviour with a period close to that of the RV variations and with a small shift in phase. We then performed a Zeeman Doppler imaging (ZDI) investigation from the Stokes V and Stokes I least-squares deconvolution (LSD) profiles. A rotational period is determined, which is consistent with the period of variations of the RV. The magnetic topology is found to be mainly poloidal and this component almost purely dipolar. The mean strength of the surface magnetic field is about 0.7 G. As an alternative to the scenario in which Pollux hosts a close-in exoplanet, we suggest that the magnetic dipole of Pollux can be associated with two temperature and macroturbulent velocity spots which could be sufficient to produce the RV variations. We finally investigate the scenarii of the origin of the magnetic field which could explain the observed properties of Pollux.