Is there a dua for praying to Allah for a son?

Is it lawful in Islam to pray to Allah for birth of a son? If yes, is there any dua for it.

بسم الله الرحمن الرحيم

(Fatwa: 448/358/B=03/1435)

Yes, it is lawful to supplicate Allah for the birth of a child. The supplication of Hadhrat Sayyidina Zakariya (على نبينا وعليه الصلاة والسلام) is mentioned in the holy Quran for the same purpose.
رَبِّ لَا تَذَرْنِي فَرْداً وَأَنتَ خَيْرُ الْوَارِثِينَ [الأنبياء : 89]
If the husband and wife recite this blessed dua with durood before and after extensively on daily basis, then they shall have a son, in-shaAllah. May Allah bless you a pious son, Amen!

Allah knows Best!

Darul Ifta,
Darul Uloom Deoband

This answer was collected from the official ifta website of Darul Uloom Deoband in India.

Link