Markandeya Recounts the Genealogies of Rama and Ravana
Markandeya begins to answer Yudhishthira's request by tracing the lineage of Rama from the Ikshvaku king Aja through Dasharatha and his four sons. Then he turns to Ravana's birth, describing how the god Prajapati's line passed through Pulastya, and how a father's anger created the sage Vishrava — the father of the rakshasa king.
Markandeya said: In the lineage of Ikshvaku, there was a great king named Aja. His son was Dasharatha — pure, always devoted to learning. Dasharatha had four sons, all learned in dharma and artha: Rama, Lakshmana, Shatrughna, and the immensely strong Bharata.
Rama's mother was Koushalya. Bharata's was Kaikeyi. Lakshmana and Shatrughna, scorchers of enemies, were the sons of Sumitra.
Janaka was the king of Videha, and his daughter was Sita. Tvashtra himself created her, so that she might be Rama's beloved queen.
That was the lineage of Rama and Sita.
Now Markandeya turned to Ravana's birth.
Ravana's great-grandfather was the god Prajapati himself — the self-creating great ascetic, lord of all the worlds. Prajapati had a beloved son named Pulastya, born through his mental powers. Through a cow, Pulastya had a son named Vaishravana.
But Vaishravana abandoned his father and went to his grandfather, Prajapati.
Pulastya was angered. In great wrath, the brahmana created another self, based on his own self — a son named Vishrava, created from half of Pulastya's own being, so that Vaishravana could be countered.
But Prajapati, delighted with Vaishravana, conferred immortality on him. He made him lord of riches and a guardian of the worlds. He gave him friendship with Ishana and a son named Nalakubara. His capital became Lanka, inhabited by masses of rakshasas. Aranyaka Parva, Chapter 555