Variations in the Earth’s lower mantle appear to influence the geodynamo operating in the liquid core. I shall present solutions to the full dynamo equations with lateral variations in heat flux on the outer boundary defined by the shear wave velocity of the lowermost mantle. The magnetic field is almost stationary and locked to the boundary, with 4 symmetrical concentrations of flux sited beneath cold mantle. This allows for the first time a direct comparison between a dynamo solution and the main features of the present geomagnetic field. Of the four main equatorially symmetric flux lobes, two (the ``Siberian’’ pair) are centered within 5 degrees of the corresponding Earth’s pair; the other two (the ``Canadian’’ pair) are not quite so close but are more mobile, as the corresponding Earth’s pair have been in the last 300 years. Our study strongly suggests that geomagnetic field morphology is dominated not only by geometry related to the inner core but also by structure in the bottom few hundred kilometres of the mantle, notably the seismically fast ring beneath the Pacific rim and large fast anomalies beneath Siberia and Canada. Tighter locking of one of the pairs of flux lobes suggests the seismic anomaly beneath the Siberian side of the ring is in some way stronger than the one on the Canadian side. The models also predict some features of the ancient magnetic field found from paleomagnetism. These locked solutions only occur for a limited parameter range with the large Ekman numbers available to numerical experiments, which explains why none have been found earlier. Locking is enhanced if the upper layers are density stratified.