Praise be to Allah.
Yes, it is permissible for you to ask Allaah to bless you with a righteous son. The Prophet of Allaah Sulaymaan (peace be upon him) wished for that. It was narrated from Abu Hurayrah (may Allaah be pleased with him) that the Prophet (peace and blessings of Allaah be upon him) said: “Sulaymaan ibn Dawood said: Tonight I shall go around to ninety wives and each woman will become pregnant with a knight who will strive for the sake of Allaah.” Narrated by al-Bukhaari (3424) and Muslim (1654). But he wished for these boys so that they would strive for the sake of Allaah and support the religion of Allaah, not just so that he could enjoy having sons.
And Zakariya (peace be upon him) prayed to his Lord and said:
“O My Lord! Leave me not single (childless), though You are the Best of the inheritors”
And Allaah says that among the prayers of the slaves of the Most Merciful are the words (interpretation of the meaning):
“And those who say: Our Lord! Bestow on us from our wives and our offspring the comfort of our eyes, and make us leaders of the Muttaqoon (the pious)”
We say “a righteous son” because a son may be a blessing for his family or he may be a curse, so we ask Allaah to bless you with a righteous son who will bring you joy.
It should be noted that Allaah gives both male and female children, to whomsoever He will, by His wisdom and knowledge. The believer can only accept and submit to the will of Allaah, and rejoice in His blessing. Allaah, may He be glorified and exalted, says (interpretation of the meaning):
“To Allaah belongs the kingdom of the heavens and the earth. He creates what He wills. He bestows female (offspring) upon whom He wills, and bestows male (offspring) upon whom He wills.
50. Or He bestows both males and females, and He renders barren whom He wills”
Having daughters is a blessing of which many people are unaware, because they are easy to raise, and because of the great reward that a person may gain through them, as the Prophet (peace and blessings of Allaah be upon him) said: “Whoever takes care of two girls until they reach puberty, he and I will come like this on the Day of Resurrection” – and he held his two fingers together. Narrated by Muslim (2631). According to al-Tirmidhi: “Whoever takes care of two girls, he and I will enter Paradise like this” and he pointed with his two fingers. Classed as saheeh by al-Albaani in Saheeh al-Tirmidhi.
May Allaah help us all to do that which He loves and which pleases Him.
And Allaah knows best.