It is narrated from Sayyiduna Abu Hurairah (may Allah be pleased with him) that he heard from the Messenger of Allah (peace and blessings be upon him): When the verse of Li'an was revealed, the Prophet (peace and blessings be upon him) was saying: "Any woman who introduces a lineage among a people that does not belong to them (i.e., a woman commits adultery, gives birth to a child, and attributes the child to her husband, claiming it is his offspring), that woman is nothing in the sight of Allah, and Allah will never admit such a woman into Paradise. And whoever knowingly denies his own child (i.e., knowingly calls his own child illegitimate), he will not be granted the vision of Allah (on the Day of Judgment), and Allah will disgrace and humiliate him before all the former and latter people." Imam Darimi (may Allah have mercy on him) said: Muhammad bin Ka'b al-Qurazi narrated this, and Sa'id, while narrating this hadith, said: This hadith has reached me from the Messenger of Allah (peace and blessings be upon him).
From this hadith, it is understood: For a woman to attribute a child born of adultery (zina) to her husband’s lineage is a very grave crime and sin. Its punishment is that such a woman, even if she is a Muslim, will never be able to enter Paradise. Similarly, if a man deliberately denies his own offspring, there is a severe warning for him as well: he will not be granted the vision of Allah, and Allah, the Exalted, will disgrace and humiliate him before all of creation.
It is also understood from this hadith that the child born of adultery (zina) will be attributed to the husband.