Praise be to Allaah.
The child of adultery is not responsible for the crime committed by his mother, and he is not to be taken to task for it, rather he is responsible for his own actions. If he is righteous and obedient then he will be one of the people of Paradise, and if he is a disobedient evildoer then he will deserve to enter Hell. So in this regard he is like all other people, and there is no difference between him and them.
If a woman has a husband and she bears a child who could be from that husband (in that he is born after six months of marriage), then this child should be attributed to her husband according to sharee’ah, and it is not permissible to deny that he belongs to him, unless the husband himself denies it and engages in li’aan with his wife to that effect.
The evidence for that is the report narrated by al-Bukhaari (2053) and Muslim (1457) which says that Sa’d ibn Abi Waqqaas and ‘Abd ibn Zam’ah disputed concerning a slave belonging to Zam’ah. Sa’d said: O Messenger of Allaah, this is the son of my brother, ‘Utbah ibn Abi Waqqaas, who asked me to take care of him because he is his son. ‘Abd ibn Zam’ah said: This is my brother, O Messenger of Allaah, the son of my father’s slave woman who was born in my father’s bed. The Messenger of Allaah (S) saw a clear resemblance to ‘Utbah. But he said: “He is yours, O ‘Abd ibn Zam’ah. The child is for the (owner of the) bed.” Then he said to Sawdah bint Zam’ah, who was one of the Mothers of the Believers (may Allaah be pleased with them): “Observe hijab from him, O Sawdah.”
If the child was born in the marital bed, he is to be attributed to the husband, and he cannot be regarded as not being his child except by means of li’aan, where the husband engages in li’aan with his wife and denies that the child is his, in which case physical resemblance is of no significance. It is clear from the hadeeth quoted above that the child concerning whom there was a dispute bore a clear resemblance to the zaani, ‘Utbah ibn Abi Waqqaas. This case of zina had taken place during the Jaahiliyyah (i.e., before Islam), and Sa’d wanted to attribute the slave to his brother who had left instructions to that effect (before he died), but the Prophet (peace and blessings of Allaah be upon him) ruled that the child belonged to the marital bed and attributed him to Zam’ah, who was the master of the slave woman. But in order to be on the safe side, he told Sawdah bint Zam’ah to observe hijab before this brother of hers.
So in this case there was both an admission of zina and a clear resemblance (to the zaani), but despite that the Prophet (peace and blessings of Allaah be upon him) affirmed that the child was to be attributed to the owner of the marital bed. This is because sharee’ah takes a cautious view in order to protect lineages and is keen to conceal sins, for the lineage is the child’s right.
Al-Nawawi (may Allaah have mercy on him) said in Sharh Muslim: With regard to the words of the Prophet (peace and blessings of Allaah be upon him), “Observe hijab from him, O Sawdah”, he told her to do that so as to be on the safe side, because he appeared to be her brother in shar’i terms, because he was attributed to her father, but when he saw that he clearly resembled ‘Utbah ibn Abi Waqqaas, he was afraid that he may have been his child, in which case he would be a stranger (non-mahram) to her, so he told her to observe hijab before him in order to be on the safe side.
Al-Qaadi ‘Iyaad (may Allaah have mercy on him) said: The custom during the Jaahiliyyah was to name children after the zaani. They used to hire slave woman for zina, and whoever the mother said that the child belonged to, they would name him after him. Then Islam came and abolished that, and ruled that the child belonged to the legitimate marriage bed. When ‘Abd ibn Zam’ah and Sa’d ibn Abi Waqqaas disputed, Sa’d did what his brother ‘Utbah ibn Abi Waqqaas had asked him to do, in accordance with the custom of Jaahiliyyah, and Sa’d was not aware that this had been abolished in Islam. The child’s paternity had not been stated during the Jaahiliyyah, either because there was no claim or because the mother did not acknowledge that he was ‘Utbah’s child. ‘Abd ibn Zam’ah claimed that he had been born on his father’s bed, so the Prophet (peace and blessings of Allaah be upon him) ruled in his favour. End quote.
Ibn Qudaamah (may Allaah have mercy on him) said: They were unanimously agreed that if a child is born on one man’s bed and another man claims him, he should not be named after him. End quote from al-Mughni (6/228).
Based on that, if you were born six months or more after your father married your mother, then you should be named after your father, and your lineage cannot be denied except by means of li’aan. You have no need to have doubts about your mother or think badly of her because you resemble someone else, because people may resemble one another without there being any zina.
Whatever the case, resemblance to the zaani or the woman’s admission of zina does not mean that the child cannot be attributed to the husband, unless the husband engages in li’aan. See the answer to question no. 33615 for information on li’aan and its consequences.
What you should do is ignore this matter and stop thinking about it, and pay attention to doing righteous deeds and adhering to this religion properly.
We ask Allaah to guide you and help you to do that which He has permitted and that which pleases Him.
And Allaah knows best.