All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
Zina (Adultery and extramarital relations) is one of the grave sins that incur the wrath of Allah if the adulterer didn`t make immediate repentance. However, the child isn`t attributed to the adulterer. Rather, he/she is attributed to the woman who got pregnant by him and, according to Sharia, it isn`t considered a legitimate child of the adulterer. And Allah The Almighty Knows Best.