He used to hear the recitation of Umar bin Khattab from the house of Abu Jahm while Umar was leading the people in prayer in the mosque of the Messenger of Allah ﷺ.Kaab al-Ahbar said, "By the One who parted the sea for Musa, Suhayb told me that Muhammad, the Messenger of Allah ﷺ, never saw a town he intended to enter without saying when he caught sight of it, 'O Allah, Lord of the seven heavens and all that they overshadow, Lord of the seven earths and all that they carry, Lord of the devils and all that they lead astray, Lord of the winds and all that they scatter, we ask You for the good of this town, the good of its people, and the good of what is in it, and we seek refuge in You from its evil, the evil of its people, and the evil of what is in it.'"Kaab swore by the One who parted the sea for Musa that these were the supplications of Dawud whenever he saw the enemy.
أنه كان يسمع قراءة عمر بن الخطاب وهو يؤم الناس في مسجد رسول الله ﷺ من دار أبي جهم، وقال كعب الأحبار: والذي فلق البحر لموسى لأن صهيبا حدثني أن محمدا رسول الله ﷺ لم ير قرية يريد دخولها إلا قال حين يراها: اللهم رب السموات السبع وما أظللن، ورب الأرضين السبع وما أقللن، ورب الشياطين وما أضللن، ورب الرياح وما ذرين، فإنا نسألك خير هذه القرية وخير أهلها، ونعوذ بك من شرها، وشر أهلها، وشر ما فيها. وحلف كعب بالذي فلق البحر لموسى لأنها كانت دعوات داود حين يرى العدو.
Nasai narrated it in Amal al-Yawm wal-Layla (543), and from him Tahawi in al-Mushkil (2529), from Muhammad bin Nasr (that is, Farra), who said, Ayub bin Sulayman bin Bilal told us, Abu Bakr bin Abu Uways told me, from Sulayman (meaning Ibn Bilal), from Abu Suhayl bin Malik, from his father, and he mentioned it. Its chain of transmission is sahih, and Malik is Ibn Abu Amir Asbahi, one of the trustworthy of the Followers.Nasai also narrated it in Amal al-Yawm wal-Layla (544), and Ibn Khuzayma declared it sahih (2565), as did Ibn Hibban (2709) and Hakim (1/446), all of them by way of Hafs bin Maysara Sanani, who said, Musa bin Uqba told me, from Ata bin Abu Marwan, from his father, from Kaab, from Suhayb, and he mentioned something similar. Its chain of transmission is hasan on account of Abu Marwan. Ibn Hajar also graded it hasan in Nataij Afkar. Hakim said, "This hadith has a sahih chain of transmission."