According to the 135th chapter of Anushāsanaparva (verses 14 to 120) in the epic Mahabharata, the names were handed down to Yudhisthira by the famous warrior Bhishma who was on his death bed (of arrows) in the battlefield of Kurukshetra. Yudhisthira asks Bhishma the following questions:
“kimekam daivatam loke
kim vāpyekam parāyaṇam
stuvantaḥ kam kamarcantaḥ prāpnuyurmānavāḥ śubham
ko dharmaḥ sarva dharmāṇām bhavataḥ paramo mataḥ
kim japan mucyate jantuḥ janmasamsārabandhanāt ”
In this universe Who is the one ("ekam") refuge ("parāyaṇam") for all? Who ("kim") is the greatest ("ekam") Lord ("daivatam") in the world ("loke")?By glorifying ("sthuvantaḥ") whom ("kam") can man ("mānavāḥ") reach the Auspiciousness ("śubam") (peace and prosperity)? By worshipping ("archantaḥ") whom can a man reach auspiciousness (peace and prosperity)?What ("ko") is, in thy opinion, the Greatest Dharma of all Dharmas? By ("kim") chanting of whose name can “creatures” (jantu) go beyond ("muchyate") the bonds ("bandhanāt") of samsāra?
Bhisma answers by stating that mankind will be free from all sorrows by chanting the Vishnu sahasranāma' which are the thousand names of the all-pervading Supreme Being Vishnu, who is the master of all the worlds, the supreme light, the essence of the universe and who is Brahman. All matter animate and inanimate reside in him and he in turn resides within all matter.
“kimekam daivatam loke
kim vāpyekam parāyaṇam
stuvantaḥ kam kamarcantaḥ prāpnuyurmānavāḥ śubham
ko dharmaḥ sarva dharmāṇām bhavataḥ paramo mataḥ
kim japan mucyate jantuḥ janmasamsārabandhanāt ”
In this universe Who is the one ("ekam") refuge ("parāyaṇam") for all? Who ("kim") is the greatest ("ekam") Lord ("daivatam") in the world ("loke")?By glorifying ("sthuvantaḥ") whom ("kam") can man ("mānavāḥ") reach the Auspiciousness ("śubam") (peace and prosperity)? By worshipping ("archantaḥ") whom can a man reach auspiciousness (peace and prosperity)?What ("ko") is, in thy opinion, the Greatest Dharma of all Dharmas? By ("kim") chanting of whose name can “creatures” (jantu) go beyond ("muchyate") the bonds ("bandhanāt") of samsāra?
Bhisma answers by stating that mankind will be free from all sorrows by chanting the Vishnu sahasranāma' which are the thousand names of the all-pervading Supreme Being Vishnu, who is the master of all the worlds, the supreme light, the essence of the universe and who is Brahman. All matter animate and inanimate reside in him and he in turn resides within all matter.