This Letter presents a search for high mass e+e- or μ+μ- resonances in pp collisions at √s=7 TeV at the LHC. The data were recorded by the ATLAS experiment during 2010 and correspond to a total integrated luminosity of ~40 pb-1. No statistically significant excess above the Standard Model expectation is observed in the search region of dilepton invariant mass above 110 GeV. Upper limits at the 95% confidence level are set on the cross section times branching ratio of Z' resonances decaying to dielectrons and dimuons as a function of the resonance mass. A lower mass limit of 1.048 TeV on the Sequential Standard Model Z' boson is derived, as well as mass limits on Z* and E6-motivated Z' models. © 2011 CERN.