Qarnayn is found in the biblical Book of Amos Chapter 6. The Book of Amos is the earliest book to be written circa 760 BCE. Amos was a Judean prophet who preached to the Kingdom of Israel and the Kingdom of Judah during the reigns of Jeroboam II of Israel and Uziah of Judah when both of these kingdoms had a rare episode of cooperation instead of warfare. In chapter six, Amos recalls both Mount Zion in Jerusalem and Mount Gerizim aka Mount Samaria in Israel. In verse 13, he mentions these 2 mounts as Qarnaim which means ‘the 2 peaks’. According to this chapter, the king of Israel and the king of Judah bragged about the conquest of their respective peaks or ‘holy mountains.’So, the Quran is referring to these 2 peaks or the one who will conquer these two mountains, bring peace and rule them.
Al Dhul Qarnayn cannot be either Alexander the Great or Cyrus the Persian because neither of these foreign kings united these 2 peaks. As a matter of fact, Cyrus’ fostering of Judah over Samaria created a deadly division between these 2 sects of Judaism which ended in a perpetual state of distrust and conflict. The conquest of Alexander brought further division as well as introduced Greek paganism into the area causing more war and conflict; eg. the Ptolemaic and Seleucid empires which fostered more hatred between the 2 sects by supporting Judah over Samaria.
The first conquest which established peace and unity in the area was under Omar Ibn AlKhattab when he introduced Islam into the area. He established Islam as a barrier which, according to the Quran, when it falls will bring the chaos of Yjuj and Majuj or peoples opposed to Islam. As predicted, that barrier fell when the practice of Islam became corrupted and weak under the corrupt Arab caliphates. The Yjuj and Majuj moved in as Christian crusaders. Islam was re-established by Al-Nasir Salah al-Din Yusuf ibn Ayyub. Later the barrier of Islam fell again and the Mongols moved in. They eventually converted to Islam. The 3rd time Islam was weakened by corrupt rulership was under the Ottomans. Again, the barrier of Islam fell and the Yjuj and Majuj moved in as Western colonial powers established the kufr of Zionism in Palestine. So, could the Quran be referring to the Prophet (saws) as the uniter of the 2 peaks? Yes, if one considers him as the founder of Islam. But, one must also consider all of the strong Muslim leaders who marched into the area to establish Islam and to rebuild it after the region fell into chaos because the practice of Islam had become corrupt under the various empires that ruled the area. We are still waiting for another Dhul Qarnayn to re-establish Islam in the area and re-unite the 2 peaks which represent the religion (Islam) of all of the muslim prophets Allah (swt) sent into that area.