Praise be to Allah.
The scholars have divided knowledge of the stars into two categories:
this refers to knowledge of the names of stars, when and where they rise and set, and how they may be used for the purposes of measuring time and for navigation, and other visible things which observation and experience have proven what each star could be used for (working out directions, measuring the passage of time and so on).
There is nothing wrong with learning and teaching this type of knowledge, and there is no evidence to suggest that it is forbidden or makrooh to study it. In fact, in the Holy Qur’an there is evidence to suggest that it is permissible and this knowledge is a blessing that Allah, may He be glorified and exalted, has bestowed upon people, as Allah, may He be glorified and exalted, says (interpretation of the meaning):
“It is He Who has set the stars for you, so that you may guide your course with their help through the darkness of the land and the sea. We have (indeed) explained in detail Our Ayat (proofs, evidences, verses, lessons, signs, Revelations, etc.) for people who know”
“It is He Who made the sun a shining thing and the moon as a light and measured out its (their) stages, that you might know the number of years and the reckoning. Allah did not create this but in truth. He explains the Ayat (proofs, evidences, verses, lessons, signs, revelations, etc.) in detail for people who have knowledge”
this refers to interpreting the locations and movements of the stars and the (supposed) influence they have on worldly developments and events such as death, birth, epidemics, disasters, attaining happiness and other matters for which there is no rational, empirical basis for connecting these developments to the movements of heavenly bodies. Rather this is mere conjecture and speculation for which there is no proof or evidence.
This is what the shar‘i evidence definitively forbids; it is haraam to learn it, teach it or study it.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
The craft of astrology which seeks to establish the influence and impact of heavenly bodies, and to find out about future earthly events or developments on the basis of celestial events, and to make a connection between celestial movements and earthly influence, is a prohibited craft according to the Qur’an and Sunnah, and the consensus of the ummah. In fact it is forbidden by all the Messengers to their communities.
Allah, may He be exalted, says (interpretation of the meaning):
“and the magician will never be successful, no matter whatever amount (of skill) he may attain”
“Have you not seen those who were given a portion of the Scripture? They believe in Jibt [sorcery] and Taghoot [evil]”
‘Umar and others said that Jibt (sorcery) refers to magic or witchcraft.
Abu Dawood narrated in his Sunan with a hasan isnaad from Qubaysah ibn Mukhaariq that the Prophet (blessings and peace of Allah be upon him) said: “Augury (observing omens in birds etc.), superstition and geomancy come under the heading of jibt (magic).”
If geomancy, which is akin to astrology, comes under the heading of jibt (magic), then how about astrology itself? That is because in geomancy they refer to shapes on earth, because astrology is based on shapes in the heavens.
Ahmad, Abu Dawood, Ibn Maajah and others narrated with a saheeh isnaad from Ibn ‘Abbaas that he said: “Whoever learns astrology learns a branch of magic; the more he learns (of the former) the more he learns (of the latter).” The Messenger of Allah (blessings and peace of Allah be upon him) clearly stated that astrology comes under the same heading as magic. Allah, may He be exalted, says (interpretation of the meaning):
“and the magician will never be successful, no matter whatever amount (of skill) he may attain”
And this is how it really is. From studying the situation of astrologers, we see that they never prosper either in this world or in the hereafter.
Ahmad, and Muslim in his Saheeh, narrated from Safiyyah bint ‘Ubayd, from one of the wives of the Prophet (blessings and peace of Allah be upon him), from the Prophet (blessings and peace of Allah be upon him) that he said: “Whoever goes to a fortune teller and asks him about something, no prayer will be accepted from him for forty days.” The astrologer is the same as the fortune teller according to some of the scholars; according to others he comes under the same category. If this is the case with regard to the one who asks, then how about the one who is asked?
He also narrated in his Saheeh that Mu‘aawiyah ibn al-Hakam as-Sulami said: I said: O Messenger of Allah, there are some men among us who go to soothsayers. He said: “Do not go to them.”
The Prophet (blessings and peace of Allah be upon him) forbade going to soothsayers, and astrologers are the same as soothsayers according to al-Khattaabi and other scholars, and this was also narrated from the Arabs. According to others, they come under the same category as soothsayers and are worse than them.
More than one of the scholars has narrated that there is consensus on the prohibition of astrology, such as al-Baghawi, al-Qaadi ‘Iyaad and others.
In as-Saheehayn it is narrated from Zayd ibn Khaalid al-Juhani that he said: The Messenger of Allah (blessings and peace of Allah be upon him) led us in praying Fajr at al-Hudaybiyah, after it had rained at night. When he finished, he turned to the people and said: “Do you know what your Lord said?” They said: Allah and His Messenger know best. He said: “He said: ‘This morning some of My slaves believe in Me and some disbelieve. As for the one who said, we got rain by the bounty and mercy of Allah, he is a believer in Me and a disbeliever in the stars. But as for the one who said, We got rain by virtue of such and such a star, he is a disbeliever in Me and a believer in the stars.’”
Leading astrologers of the earlier and later generations have admitted that in the case of the believers who worship Allah and turn to Him in supplication, Allah removed from them – by virtue of the blessing of their worship, supplication and trust in Allah – that which the astrologers said on the basis of their astrological calculations would inevitably befall them. They have also admitted that those who worship Allah, call upon Him and put their trust in Him will be given reward in this world and in the hereafter that no astrological power could ever bring them.
Praise be to Allah Who has made the best of this world and the Hereafter in following the Messengers, and has made the best nation those who enjoin what is good and forbid what is evil.
End quote from Majmoo‘ al-Fataawa, 35/192-196
However, we do not deny that some of what the astrologer says about future events may sometimes be correct and may sometimes happen as he foretold; but that does not mean that the path he is following is valid. Rather what he happens to get right is baseless and comes about by pure coincidence. What he gets right is very little in comparison to the lies that accompany it.
Do you not see that the Prophet (blessings and peace of Allah be upon him) has told us that the jinn who eavesdrop (on the angels) may hear something of what the angels talk about of future events, and the jinni may send down what he has heard to the soothsayer on earth, or the jinni may be burned before he can do that? Yet despite that, soothsaying is a major sin, because it deals with matters of the unseen without any shar‘i basis.
It was narrated from ‘Aa’ishah (may Allah be pleased with her), the wife of the Prophet (blessings and peace of Allah be upon him) that she heard the Messenger of Allah (blessings and peace of Allah be upon him) say:
“The angels come down in the clouds and discuss matters that have been decreed in heaven, and the devils may eavesdrop and hear it, then they convey it to the soothsayers, and they tell along with it one hundred lies that they have fabricated by themselves.”
Narrated by al-Bukhaari, no. 3210
Hence al-Qaadi ‘Iyaad (may Allah have mercy on him) said:
Allah may create in this type – meaning the astrologers – some kind of power, but their lies are what predominates. End quote.
Quoted from Sharh an-Nawawi ‘ala Muslim, 14/223
Shaykh Ibn Baaz (may Allah have mercy on him) said:
It may so happen that the divine decree is in accordance with a person’s need, so the poor man thinks that it is because of this astrologer, or because of this soothsayer, that this thing happened. Or it may be that a person prescribes a regular remedy other than what the astrologer claims, and that the person who prescribes it knows that it is good for this sickness, but the sick person thinks that healing comes about only because of the astrologers looking at the stars, and so on. The point is that if healing occurs sometimes after going to soothsayers or astrologers or geomancers and their ilk, that does not prove that their way is sound. The mushrikeen themselves – who worship idols – may come to an idol and ask of it, then what they wanted happens by Allah’s leave, as a coincidence and for reasons known to Allah in His wisdom, or it may come about by means of the devils, and thus becomes a trial and test. But it does not come from the idol, because the idol did not do anything, and the jinni who is with him did not do anything. Rather the divine decree may dictate that this sickness should go away or this calamity should be alleviated after this poor man went to the idol and asked of it or offered a sacrifice to it. Thus that comes about as a test and trial in itself, without that being the result of any action on the part of the magician, the idol, the jinn and so on. This made the mushrikeen even more attached to their idols, and thus they worshipped them instead of Allah.
The wise person should never be deceived by what happens at the hands of these astrologers, soothsayers, fortune tellers or magicians; rather he must keep away from them and not believe in them.
End quote from Majmoo‘ Fataawa Ibn Baaz, 8/89-90
Once the above is clearly understood, there will be no confusion from a scientific or shar‘i point of view about the story of the astrologers at the time of Nimrood and Ibraaheem (peace be upon him), if the story is even sound in the first place. It is not unlikely that the words of the astrologers may have turned out to be correct, although lies are more prevalent in their case and the type of knowledge they have is corrupt.
Yet we should point out that the story is not proven with any saheeh isnaad; rather it was narrated by some of the historians as just a story with no real proof.
See: al-Bidaayah wa’n-Nihaayah by Ibn Katheer, 1/200
And Allah knows best.