Source: Mahabharata Vana Parva, Teertha Yatra Upa-parva: Mahabharata Tatparya Nirnaya, Chapter 22
After the killing of Vrutrasura by Indra, the Brahma Hatya dosha starts to chase Indra as Vrutra was a Brahmin. In order to avoid this, Indra goes to Manasa Sarovara and, assuming a tiny form, enters into the stem of a Lotus flower and starts performing a tapas. The devatas start looking for a temporary replacement for Indra. Since none of the devatas desire that position, they start searching for a replacement amongst humans.
They meet and request King Nahusha, the ancestor of the Pandavas, to occupy the post. Nahusha readily agrees but asks for a boon in return. He asks that he should gain the Punya of anyone at whom he gazes. The devatas grant him this boon and he takes over the reigns of Swarga Loka.
Slowly, power and ego gets to Nahusha’s mind and he becomes very arrogant. He starts behaving autocratically and bosses over all. Due to the boon granted, the devatas become powerless to challenge. One day, he demands that the wife of Indra, Sachi Devi, be given to him. This enrages the devatas and they approach Brihaspati for a solution. Brihaspati visits Indra in Manasa Sarovara and consults him. He then approaches Sachi Devi and tells her of Indra’s suggestion. Sachi Devi goes to Nahusha and tells him that she will accept him if he arrives to her palace being carried by the Sapta Rishis. Nahusha agrees to this suggestion and orders for the arrangement.
The Sapta Rishis also are affected by the boon which Nahusha has but Bhrigu Rishi, who till then had never come in front of Nahusha, sits inside of Sage Agastya. As the palanquin is being carried, Nahusha gets unhappy with the work of the sages and, in his haughtiness, he kicks Sage Agastya. Sage Bhrigu uses this opportunity and curses Nahusha that he should be born as a snake on earth. He also curses that he will be relieved from the curse only when a noble man answers his philosophical question. The curse to become a snake was because Nahusha keeps shouting “Sarpa” while kicking the sages. Sarpa in sanskrit also means “move fast” along with the normal meaning of “snake”.
Once, during the teertha yatra of the Pandavas during their exile, Bhimasena is attacked by this very snake and is held. The snake has a boon that it will succeed in holding anyone it desires. Bhimasena decides to honor this boon and remains in the clutches of the snake. He refuses to answer any question that the snake wants to pose as it is against Dharma to trade knowledge to free oneself.
Yudhisthira, meanwhile, spots some omens and approaches the place in search of Bhimasena. Seeing the snake holding Bhimasena and learning the entire story, Yudhisthira agrees to answer the snake’s question in order to free his brother.
The snake poses only one question to Dharma – “Who is a Brahmana?”
Yudhisthira gives a very beautiful answer which is very relevant especially in today’s society. I am posting some excerpts of his answer from the freely available english translation of the Bharata.
‘O foremost of serpents, he, it is asserted by the wise, in whom are seen truth, charity, forgiveness, good conduct, benevolence, observance of the rites of his order and mercy is a Brahmana’
Those characteristics that are present in a Sudra, do not exist in a Brahmana; nor do those that are in a Brahmana exist in a Sudra. And a Sudra is not a Sudra by birth alone–nor a Brahmana is Brahmana by birth alone. He, it is said by the wise, in whom are seen those virtues is a Brahmana. And people term him a Sudra in whom those qualities do not exist, even though he be a Brahmana by birth. And again, as for thy assertion that the object to be known (as asserted by me) doth not exist, because nothing exists that is devoid of both (happiness and misery), such indeed is the opinion, O serpent, that nothing exists that is without (them) both. But as in cold, heat doth not exist, nor in heat, cold, so there cannot exist an object in which both (happiness and misery) cannot exist?”
“In human society, O mighty and highly intelligent
serpent, it is difficult to ascertain one’s caste, because of promiscuous intercourse among the four orders. This is my opinion. Men belonging to all orders (promiscuously) beget offspring upon women of all the orders. And of men, speech, sexual intercourse, birth and death are common. And to this the Rishis have borne testimony by using as the beginning of a sacrifice such expressions as–of what caste so ever we may be, we celebrate the sacrifice. Therefore, those that are wise have asserted that character is the chief essential requisite. The natal ceremony of a person is performed before division of the umbilical cord. His mother then acts as its Savitri and his father officiates as priest. He is considered as a Sudra as long as he is not initiated in the Vedas. Doubts having arisen on this point, O prince; of serpents, Swayambhuba Manu has declared, that the mixed castes are to be regarded as better than the (other) classes, if having gone through the ceremonies of purification, the latter do not conform to the rules of good conduct, O excellent snake! Whosoever now conforms to the rules of pure and virtuous conduct, him have I, ere now, designated as a Brahmana.’
After this reply, Nahusha is very pleased. Yudhisthira now poses several questions to the snake and gets learned answers. At the end of the discussion, Nahusha releases Bhimasena and blesses both of them and returns to Swarga Loka, his curse being relieved.
Actually, Sri Madhvacharya has clarified in the MBTN that the real reason behind Bhimasena not freeing himself was to ensure that Nahusha’s excess punya gets removed due to his holding of Bhimasena. Just like Paapa, excess Punya over and above what one qualifies for, is not good. Hence the reaction from Bhimasena.