Co-doped ZnO is the prototypical dilute magnetic oxide, showing many of the characteristics of ferromagnetism. The microscopic origin of the long-range order, however, remains elusive, since the conventional mechanisms for magnetic interaction, such as super-exchange and double exchange, fail either at the fundamental or at a quantitative level. Intriguingly, there is growing evidence that defects both in point-like and in extended form play a fundamental role in driving the magnetic order. Here, we explore one such possibility by performing ab initio density functional theory calculations for the magnetic interaction of Co ions at or near a ZnO (10 (1) over bar0) surface. We find that extended surface states can hybridize with the e-levels of Co and efficiently mediate the magnetic order, although such a mechanism is effective only for ions placed in the first few atomic planes near the surface. We also find that the magnetic anisotropy changes at the surface from a hard-axis easy plane to an easy axis, with an associated increase in its magnitude. We then conclude that clusters with high densities of surfacial Co ions may display blocking temperatures much higher than in the bulk.