Adi Parva, Mahabharata/Mahabharata Book I Chapter 32
Adi Parva, Mahabharata/Mahabharata Book I Chapter 36 : English
"Saunaka said, 'O child, thou hast named many of the serpents gifted with great energy and incapable of being easily overcome. What did they do after hearing of that curse?'
"Sauti said, 'The illustrious Sesha (I.32.2) amongst them, of great renown, leaving his mother practised hard penances, living upon air and rigidly observing his vows. He practised these ascetic devotions, repairing to Gandhamadana (I.32.3), Badari (I.32.3), Gokarna (I.32.3), the woods of Pushkara i.e. Pushkararanya (पुष्करारण्य) (I.32.3), and the foot of Himavat (I.32.3). And he passed his days in those sacred regions, some of which were sacred for their water and others for their soil in the rigid observance of his vows, with singleness of aim, and his passions under complete control. And the Grandsire of all, Brahma, saw that ascetic with knotted hair (जटा) (I.32.3), clad in rags, and his flesh, skin, and sinews dried up owing to the hard penances he was practising. And the Grandsire addressing him, that penance-practising one of great fortitude, said, 'What is that thorn doest, O Sesha? Let the welfare of the creatures of the worlds also engage thy thoughts. O sinless one, thou art afflicting all creatures by thy hard penances. O Sesha, tell me the desire implanted in thy breast.'
"And Sesha replied, 'My uterine brothers are all of wicked hearts. I do not desire to live amongst them. Let this be sanctioned by thee. Like enemies they are always jealous of one another. I am, therefore, engaged in ascetic devotions. I will not see them even. They never show any kindness for Vinata (I.32.10) and her son. Indeed, Vinata's son capable of ranging through the skies, is another brother of ours. They always envy him. And he, too, is much stronger owing to the bestowal of that boon by our father, the high-souled Kasyapa (I.32.11). For these, I engaged in ascetic penances, and I will cast off this body of mine, so that I may avoid companionship with them, even in another state of life.'
p. 84
"Unto Sesha who had said so, the Grandsire said, 'O Sesha, I know the behaviour of all thy brothers and their great danger owing to their offence against their mother. But O Snake, a remedy (for this) hath been provided by me even beforehand. It behoveth thee not to grieve for thy brothers. O Sesha, ask of me the boon thou desirest. I have been highly gratified with thee and I will grant thee today a boon. O best of snakes, it is fortunate that thy heart hath been set on virtue. Let thy heart be more and more firmly set on virtue.'
"Then Sesha replied, 'O divine Grandsire, this is the boon desired by me; viz., may my heart always delight in virtue and in blessed ascetic penances, O Lord of all!'
"Brahman said, 'O Sesha, I am exceedingly gratified with this thy self-denial and love of peace. But, at my command, let this act be done by thee for the good of my creatures. Bear thou, O Sesha, properly and well this Earth so unsteady with her mountains and forests, her seas and towns and retreats, so that she may be steady.'
"Sesha said, 'O divine Lord of all creatures, O bestower of boons, O lord of the Earth, lord of every created thing, lord of the universe, I will, even as thou sayest hold the Earth steady. Therefore, O lord of all creatures, place her on my head.'
"Brahman said, 'O best of snakes, go underneath the Earth. She will herself give thee a crevice to pass through. And, O Sesha, by holding the Earth, thou shalt certainly do what is prized by me very greatly.'
"Sauti continued, 'Then the elder brother of the king of the snakes, entering a hole, passed to the other side of the Earth, and holding her, supported with his head that goddess with her belt of seas passing all round.'
"Brahman said, 'O Sesha (I.32.23), O best of snakes, thou art the god Dharma, because alone, with thy huge body, thou supportest the Earth with everything on her, even as I myself, or Valavit (I.32.23) (Indra), can.'
"Sauti continued, 'The snake, Sesha, the lord Ananta (I.32.23), of great prowess, lives underneath the Earth, alone supporting the world at the command of Brahman. And the illustrious Grandsire, the best of the immortals, then gave unto Ananta the bird of fair feathers, viz., the son of Vinata, for Ananta's help.'"
So ends the thirty-sixth section in the Astika Parva of the Adi Parva.
https://www.sacred-texts.com/hin/m01/m01037.htm
Adi Parva, Mahabharata/Mahabharata Book I Chapter 32:Sanskrit
1 [ष] जाता वै भुजगास तात वीर्यवन्तॊ दुरासदाः शापं तं तव अथ विज्ञाय कृतवन्तॊ नु किं परम 2 [स] तेषां तु भगवाञ शेषस तयक्त्वा कद्रूं महायशाः तपॊ विपुलम आतस्थे वायुभक्षॊ यतव्रतः 3 गन्धमादनम आसाद्य बदर्यां च तपॊ रतः गॊकर्णे पुष्करारण्ये तथा हिमवतस तटे 4 तेषु तेषु च पुण्येषु तीर्थेष्व आयतनेषु च एकान्तशीली नियतः सततं विजितेन्द्रियः 5 तप्यमानं तपॊ घॊरं तं ददर्श पितामहः परिशुष्कमांसत्वक सनायुं जटाचीरधरं परभुम 6 तम अब्रवीत सत्यधृतिं तप्यमानं पितामहः किम इदं कुरुषे शेषप्रजानां सवस्ति वै कुरु 7 तवं हि तीव्रेण तपसा परजास तापयसे ऽनघ बरूहि कामं च मे शेषयत ते हृदि चिरं सथितम 8 [षेस] सॊदर्या मम सर्वे हि भरातरॊ मन्दचेतसः सह तैर नॊत्सहे वस्तुं तद भवान अनुमन्यताम 9 अभ्यसूयन्ति सततं परस्परम अमित्रवत ततॊ ऽहं तप आतिष्ठे नैतान पश्येयम इत्य उत 10 न मर्षयन्ति सततं विनतां ससुतां च ते अस्माकं चापरॊ भराता वैनतेयः पितामह 11 तं च दविषन्ति ते ऽतयर्थं स चापि सुमहाबलः वरप्रदानात स पितुः कश्यपस्य महात्मनः 12 सॊ ऽहं तपः समास्थाय मॊक्ष्यामीदं कलेवरम कथं मे परेत्य भावे ऽपि न तैः सयात सह संगमः 13 [बरह्मा] जानामि शेषसर्वेषां भरातॄणां ते विचेष्टितम मातुश चाप्य अपराधाद वै भरातॄणां ते महद भयम 14 कृतॊ ऽतर परिहारश च पूर्वम एव भुजंगम भरातॄणां तव सर्वेषां न शॊकं कर्तुम अर्हसि 15 वृणीष्व च वरं मत्तः शेषयत ते ऽभिकाङ्क्षितम दित्सामि हि वरं ते ऽदय परीतिर मे परमा तवयि 16 दिष्ट्या च बुद्धिर धर्मे ते निविष्टा पन्नगॊत्तम अतॊ भूयश च ते बुद्धिर धर्मे भवतु सुस्थिरा 17 [षेस] एष एव वरॊ मे ऽदय काङ्क्षितः परपितामह धर्मे मे रमतां बुद्धिः शमे तपसि चेश्वर 18 [बर] परीतॊ ऽसम्य अनेन ते शेषदमेन परशमेन च तवया तव इदं वचः कार्यं मन्नियॊगात परजाहितम 19 इमां महीं शैलवनॊपपन्नां; ससागरां साकर पत्तनां च तवं शेषसम्यक चलितां यथावत; संगृह्य तिष्ठस्व यथाचला सयात 20 [षेस] यथाह देवॊ वरदः परजापतिर; महीपतिर भूतपतिर जगत्पतिः तथा महीं धारयितास्मि निश्चलां; परयच्छ तां मे शिरसि परजापते 21 [बर] अधॊ महीं गच्छ भुजंगमॊत्तम; सवयं तवैषा विवरं परदास्यति इमां धरां धारयता तवया हि मे; महत परियं शेषकृतं भविष्यति 22 [स] तथेति कृत्वा विवरं परविश्य स; परभुर भुवॊ भुजग वराग्रजः सथितः बिभर्ति देवीं शिरसा महीम इमां; समुद्रनेमिं परिगृह्य सर्वतः 23 [बर] शेषॊ ऽसि नागॊत्तम धर्मदेवॊ; महीम इमां धारयसे यद एकः अनन्त भॊगः परिगृह्य सर्वां; यथाहम एवं बलभिद यथा वा 24 [स] अधॊ भूमेर वसत्य एवं नागॊ ऽनन्तः परतापवान धारयन वसुधाम एकः शासनाद बरह्मणॊ विभुः 25 सुपर्णं च सखायं वै भगवान अमरॊत्तमः परादाद अनन्ताय तदा वैनतेयं पितामहः