It is forbidden (haram) in Islam, because of this passage:
Allah hath not assigned unto any man two hearts within his body, nor hath He made your wives whom ye declare (to be your mothers) your mothers, nor hath He made those whom ye claim (to be your sons) your sons. This is but a saying of your mouths. But Allah saith the truth and He showeth the way.
Proclaim their real parentage. That will be more equitable in the sight of Allah. And if ye know not their fathers, then (they are) your brethren in the faith, and your clients. And there is no sin for you in the mistakes that ye make unintentionally, but what your hearts purpose (that will be a sin for you). Allah is ever Forgiving, Merciful. Quran 33:4-5