Ruling on using eggs or sperm from someone other than the spouses in artificial insemination
Question

What is the ruling on artificial insemination using eggs or sperm from someone other than the spouses, or using a surrogate mother? To whom should the child be attributed in such cases?
Praise be to Allah.If a third party, other than the spouses, is introduced into the process of fertilization, such as eggs coming from another woman or another woman acting as a surrogate mother, or sperm coming from another man, then fertilization in such cases is haram, because it is counted as zinaa (adultery). When a woman uses the sperm of a man, this comes under the same rulings as intercourse in terms of what is halal and what is haram. 
With regard to the child who is born as the result of such a process, he is to be attributed to the mother who bore him, and not to the man who produced the sperm, as is the ruling in the case of zinaa (fornication or adultery). If that man claims to be the father and no one disputes that, then the child may be attributed to him, because the Lawgiver is keen that people should be named after their fathers. With regard to the hadith, “The child belongs to the (marriage-)bed and for the adulterer is the stone,” it is to be interpreted as referring to cases where there is a dispute, as is clear from the incident which gave rise to this hadith.