Where the story is told
The story is in Quran 18:83-98, in Surah al-Kahf. People ask the Prophet ﷺ about Dhul-Qarnayn, and he is told to say that he will recite a report about him.
The meaning of the next verse is that Allah had established him on the earth and had given him a way to everything he needed. The story that follows shows how he used this power. His name is often understood to mean "the one with the two horns", but the Quran does not explain why he was called this.
The first two journeys
The Quran says that he followed a way until he reached the setting of the sun. The meaning of the verse is that he found it as if setting in a spring of dark mud, and he found a people near it. This describes what he saw as he stood there.
Allah gave him a choice: to punish them or to treat them with goodness. His answer was fair. Whoever does wrong will be punished, and then returned to his Lord for a terrible punishment. Whoever believes and does good will have the reward of Paradise, and he will speak to that person with ease (18:87-88).
Then he followed another way until he reached the rising of the sun, where he found a people who had no shelter from it (18:90-91).
The people between the two mountains
On the third journey he reached a place between two mountains, and beside it he found a people who could hardly understand speech (18:93). They explained their problem: Yajuj and Majuj were spreading corruption in the land, and they offered to pay him to build a barrier.
He answered that what his Lord had established him in was better than their payment. He asked only for their strength and help, and promised to build a dam between them and Yajuj and Majuj (18:95).
The barrier of iron and copper
The Quran then describes the work step by step. He asked them to bring sheets of iron, and he leveled them between the two mountain walls. He told them to blow on the fire until the iron glowed like fire, then asked for molten copper to pour over it (18:96).
Yajuj and Majuj could neither climb over it nor dig through it (18:97).
When it was finished, he did not praise himself. He said, «قَالَ هَٰذَا رَحْمَةٌۭ مِّن رَّبِّى ۖ فَإِذَا جَآءَ وَعْدُ رَبِّى جَعَلَهُۥ دَكَّآءَ ۖ وَكَانَ وَعْدُ رَبِّى حَقًّۭا» The meaning is that this barrier is a mercy from his Lord, but when the promise of his Lord comes, He will level it, and the promise of his Lord is true.
Yajuj and Majuj in the Quran and the Sunnah
Yajuj and Majuj are also mentioned in Surah al-Anbiya. Quran 21:96-97 says that when they are let loose they will descend from every elevation, and the true promise will draw near.
An authentic hadith speaks about an opening in the barrier. Zaynab bint Jahsh, may Allah be pleased with her, reported that the Prophet ﷺ came to her alarmed and said that there is no god but Allah, and woe to the Arabs from an evil that has come near. An opening had been made that day in the barrier of Yajuj and Majuj like this, and he made a circle with his thumb and the next finger. She asked whether they could be destroyed while righteous people were among them, and he said yes, when evil and corruption increase (Sahih al-Bukhari 3346 and 7135, Sahih Muslim 2880).
A similar report from Abu Hurayrah, may Allah be pleased with him, mentions the same opening (Sahih al-Bukhari 3347, Sahih Muslim 2881). The hadith is a warning to keep away from corruption. It gives no dates or details, and we should not add any.
What the Quran does not tell us
The Quran does not say who Dhul-Qarnayn was, when or where he lived, or what language he spoke. It does not give the location of the two mountains or the barrier. Scholars have offered different opinions about his identity, and about whether he was a prophet or a righteous king, but the Quran does not settle these matters.
It also does not describe the appearance or number of Yajuj and Majuj. It is better to stop where the Quran and the authentic Sunnah stop.
Lessons from this story
- Power is a trust. Dhul-Qarnayn used what Allah gave him to be fair, to help the weak, and to stop corruption.
- He refused payment and asked only for honest help. A good helper does not make the weak pay for what he can do himself.
- The believer works with real effort, with iron, fire and copper, but gives the credit to his Lord: "This is a mercy from my Lord."
- Every strong thing in this world has an end. The barrier will be leveled when Allah's promise comes, and that promise is true.
- Where the Quran is silent about names, places and dates, the lesson matters more than the missing detail.
General information for learning, not a fatwa. For your own situation, ask a qualified scholar.
Sources
- Quran 18:83-98 (Surah al-Kahf)
- Quran 21:96-97 (Surah al-Anbiya)
- Sahih al-Bukhari 3346
- Sahih al-Bukhari 7135
- Sahih Muslim 2880