The book of Ezra mentions that after Artaxerxes stopped the rebuilding of the temple that it began again during the reign of Darius. Is this Darius II that reigned after Artexerxes or is this Darius I and the Ahasuerus and Artexerxes mentioned in chapter 4 Cambyses and Smerdis? This is all a bit confusing. Thanks.
The Darius during whose reign the temple was built is Darius I. The rebuilding of the temple happened in 516 BC, as recorded in Haggai and Zechariah. Darius I reigned from 522-486 BC–a very long reign, which included the time of the rebuilding of the temple. Darius II ruled from 423-405 BC, which is after the end of the recorded events in the Old Testament.
Here is why you might be confused. Ezra is not fully chronlogical. I am not sure why this is the case, but it is not. Ezra chapters 1-4:5 concerns the first return under Cyrus in about 538 BC. During this time, many returned, cleared part of the rubble of the former temple, and laid a foundation for the temple. Unfortunately, there was opposition and the temple was not completed at this time. The story picks up with the letter of Tattenai to Darius, the decree of Darius to rebuild the temple, and the actual building during the reign of Darius in chapters 5-6. These events happened between 521 and 516 BC (and they are also found in Haggai and Zechariah). What can be confusing is that, for some reason, Ezra 4:6-23 is an interlude involving things that happened quite a bit later–during the reign of Artaxerxes, and possibly Xerxes as well (there is some doubt which king is referred to in Ezra 4:6). If you do not know the chronology of the kings, then Ezra 4:24 definitely could be confusing: “Thus the work on the house of God in Jerusalem came to a standstill until the second year of Darius king of Persia.” This verse, chronologically, belongs immediately after Ezra 4:5. It is what connects the suspension of the building during the reign of Cyrus and the resumption of the work twenty years later under Darius I.
I cannot explain how Ezra 4:6-23 ended up where it is. It is worth noting that Ezra 4:8-6:18 is in Aramaic, while the material before 4:8 is in Hebrew and the material after 6:18 is also in Hebrew. Possibly the material on Artaxerxes in 4:6-23 ended up where it is because it is in Aramaic and editors put the Aramaic material together.
What is important is that there is no historical error in Ezra. It is an accurate account of what happened, even if a later editor of the material put it together in an incorrect chronological order.
By the way, the material in Ezra 7 and following occurs after Ezra 4:6-23. Therefore, the book is chronological except for the little part in Ezra 4 which, chronologically, should be moved back about two chapters. The part of Ezra beginning in chapter 7 involves things in which Ezra himself played a role.