Zayd bin Khalid reported,

Rain fell upon the people during the time of the Prophet ﷺ, so he said, "Did you not hear what your Lord said tonight? He said, 'I do not bestow a blessing upon My servants except that a group among them disbelieve in it, saying, We were given rain by such and such a star. As for the one who believes in Me and praises Me for sending the rain, that is the one who believes in Me and disbelieves in the stars. And the one who says, We were given rain by such and such a star, that is the one who disbelieves in Me and believes in the stars.'"

Nasai 1526

Sahih

أخبرنا قتيبة قال حدثنا سفيان عن صالح بن كيسان عن عبيد الله بن عبد الله

عن زيد بن خالد الجهني قال

مطر الناس على عهد النبي ﷺ فقال ألم تسمعوا ماذا قال ربكم الليلة قال ما أنعمت على عبادي من نعمة إلا أصبح طائفة منهم بها كافرين يقولون مطرنا بنوء كذا وكذا فأما من آمن بي وحمدني على سقياي فذاك الذي آمن بي وكفر بالكوكب ومن قال مطرنا بنوء كذا وكذا فذاك الذي كفر بي وآمن بالكوكب

النسائي 1526صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Istisqa
Chapter
Disapproval of seeking rain by the stars
Numbering
Darussalam 1526
Nasai 1526