Sunan Abi Dawud, Book 2, Hadith 67 (Abu Dawud 457)

Narrated Maymunah ibn Sa'd:

I said: Messenger of Allah, tell us the legal injunction about (visiting) Bayt al-Muqaddas (the dome of the Rock at Jerusalem). The Messenger of Allah (ﷺ) said: go and pray there. All the cities at that time were effected by war. If you cannot visit it and pray there, then send some oil to be used in the lamps.