The posterior hippocampus tracks distance to a newly learned location, as well as familiar environments. By contrast, when navigating a familiar location, the retrosplenial cortex takes over responsibility for tracking distance. The findings shed light on how the brain navigates and encodes spatial information.