Allah tells us that Dhul-Qarnayn then traveled from the west of the earth towards the east. Every time he passed a nation, he subjugated the people and called them to Allah. If they obeyed him, all well and good, otherwise he would humiliate them and take their wealth and possessions. From every nation he took what his armies needed to fight the next nation. When he reached the place where the sun rises, as Allah says,
(he found it rising on a people) meaning a nation,
(for whom We (Allah) had provided no shelter against the sun.) meaning, they had no buildings or trees to cover them and shade them from the heat of the sun. Qatadah said, "It was mentioned to us that they were in a land where nothing grew, so when the sun rose they would go into tunnels until it had passed its zenith, then they would come out to go about their daily lives and earn themselves a living."
(So (it was)! And We knew all about him.) Mujahid and As-Suddi said, "This means that Allah knew everything about him and his army, and nothing was hidden from Him, even though they came from so many different nations and lands. For,
(Truly, nothing is hidden from Allah, in the earth or in the heaven.)3:5"