It is narrated from Sayyiduna Abu Hurayrah (may Allah be pleased with him) that "the Prophet (peace and blessings be upon him) forbade looking into the stars (astrology)."
I (al-Busiri) say: This hadith has a shahid (supporting narration) from the hadith of Sayyiduna Anas bin Malik (may Allah be pleased with him), which has already passed in the Book of Qadar (Divine Decree).
Hafiz al-Mundhiri (may Allah have mercy on him) said: The kind of astrology that is forbidden is the knowledge by which its practitioners claim to know future events and happenings, such as the coming of rain, the falling of snow, the blowing of winds, the rise and fall of prices and the like. They claim to perceive these matters from the movement of the stars, their conjunctions, their separations and their appearance at particular times; yet this is knowledge of the unseen which Allah Almighty has reserved for Himself, and no one besides Him knows it. As for the kind of astronomy that is obtained merely through observation, by which the declining of the sun from the meridian, the direction of the qiblah, and how much of the night and day has passed or remains are known, it is not included in this prohibition. And Allah knows best.
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب العلم / 378
Hadith Gradingمحدثین:إسناده شديد الضعف؛ لضعف عقبة الأصم، وله شاهد