Revelation 21:23

The city had no need of the sun or of the moon to shine in it Although most take this passage to indicate there will be no more sun or moon, the passage need not preclude the existence of the sun and moon. It merely indicates that the city had no need of their light because of the Shekinah glory of God in the midst of the city.

The form of expression would not make impossible the existence of the sun and the moon, as this scripture merely says there is no need of them.1

Neither the sun nor the moon will ever really be destroyed, of course, since God has promised that they, as well as all the starry heavens, will endure forever (Psalm Ps. 148:3-6; Daniel Dan. 12:3). It is just that their light is no longer needed to illumine the holy city, for the city itself radiates light to all the surrounding regions (Rev. Rev. 21:24+). However, the sun and moon will continue to serve their present functions with respect to the nether regions of the earth, serving there as lights by day and night, respectively.2

It is difficult to be dogmatic as to whether the sun and moon will necessarily exist in the eternal state. It may be that there is no sun and moon, as in the early part of creation week.3The city will be bright enough to supply illumination for the whole new creation (Alford, Lee).4 God created light on the first day (Gen. Gen. 1:3), but the sun and moon were not created until the fourth day (Gen. Gen. 1:14):

On the fourth day the luminaries were made; because God, who possesses foreknowledge, knew the follies of the vain philosophers, that they were going to say, that the things which grow on the earth are produced from the heavenly bodies, so as to exclude God. In order, therefore, that the truth might be obvious, the plants and seeds were produced prior to the heavenly bodies, for what is posterior cannot produce that which is prior.Theophilus of Antioch5

Here we see one of the primary characteristics of the eternal state: it stands as the restoration of many things from the early creation. See Genesis and Revelation as Bookends. Several passages use the sun and moon as witnesses of eternal promises:

Thus says the LORD, Who gives the sun for a light by day, the ordinances of the moon and the stars for a light by night, Who disturbs the sea, and its waves roar (The LORD of hosts is His name):  If those ordinances depart from before Me, says the LORD, then the seed of Israel shall also cease from being a nation before Me forever. Thus says the LORD: If heaven above can be measured, and the foundations of the earth searched out beneath, I will also cast off all the seed of Israel for all that they have done, says the LORD. (Jer. Jer. 31:35-37) [emphasis added]

Once I have sworn by My holiness; I will not lie to David: His seed shall endure forever, And his throne as the sun before Me; it shall be established forever like the moon, even [like] the faithful witness in the sky. Selah. (Ps. Ps. 89:35-37) [emphasis added]

These passages tie Gods faithfulness in promises regarding Israel and the Davidic throne to the continuance of the sun and moon: It shall be established forever like the moon. Whether these promises are meant to extend only to the end of the present order (Rev. Rev. 21:1+) or beyond into the eternal order is difficult to determine. The specifics of these promises may no longer pertain after the Millennial Kingdom , once Israels promises have been fulfilled and the Lambs Davidic throne is merged with the Fathers throne (Rev. Rev. 22:3+). The reliance of these promises on the sun and moon may infer their continued existence in the eternal state. Another piece of evidence which points to the continuance of the moon in the eternal state is the tree of life. The tree is said to yield its fruit every month (Rev. Rev. 22:2+). Month is μῆνα [mēna] : Luke 1:24); in reference to religious festivals held at the time of the new moon new moon (Gal. Gal. 4:10).6 Mention of a monthly cycle implies that the moon may still be present and continue to serve for signs and seasons (Gen. Gen. 1:14). The existence of the moon for calendrical reasons would imply the continuance of the sun as well, since the moon reflects the light of the sun.

the glory of God illuminated it. The Lamb is its light. Isaiah saw a day, after the punishment of the host of exalted ones (probably fallen angels), when the brightness of the Shekinah glory would make the moon disgraced and the sun ashamed (Isa. Isa. 24:23). Now, the glory of the Lord serves in their stead. Whether or not the sun and moon actually cease to exist, the Shekinah glory of God will serve in their place in the city and its vicinity:

The sun shall no longer be your light by day, nor for brightness shall the moon give light to you; but the Lord will be to you an everlasting light, and your God your glory. Your sun shall no longer go down, nor shall your moon withdraw itself; for the Lord will be your everlasting light, and the days of your mourning shall be ended. (Isa. Isa. 60:19-20)

Similarly, the glory of the Lord illuminated the holy of holies within the original Tabernacle:

The dwelling-place of Gods glory in the Tabernacle and the Temple on earth had no light of sun or moon; for the Shechinah or glory of God was sufficient.7

What has happened? Man has been brought fully into the holy of holies which is lit only by Gods glory! Again, we see the emphasis on the communion of man with a holy God. There is no longer any separation of any sort because sin has been completely done away with. This is why there was still a Millennial Temple during the thousand years, but not Temple building in the New Jerusalem. In the Millennium, sin still existed (Isa. Isa. 65:20; Rev. Rev. 20:7-10+). In our own day, the Lamb serves as the spiritual light bringing revelation to men (Luke Luke 2:32; John John 1:4-5; John 8:12). God is light and in Him is no darkness at all (1Jn. 1Jn. 1:5). Gods glory had been seen in the millennial Jerusalem, but the New Jerusalem will eclipse everything from the previous order:

Arise, shine; for your light has come! And the glory of the LORD is risen upon you. For behold, the darkness shall cover the earth, and deep darkness the people; but the LORD will arise over you, and His glory will be seen upon you. The Gentiles shall come to your light, and kings to the brightness of your rising. (Isa. Isa. 60:1-3)

3 Sun and moon, the luminaries of the first creation (Gen. Gen. 1:14) have no place in the second; cf. Isa. Isa. 60:19.Henry Barclay Swete, The Apocalypse of St. John (Eugene, OR: Wipf and Stock Publishers, 1998, 1906), Rev. 21:23.