All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
First of all, you are obliged to hasten to sincerely repent to Allaah while fulfilling the conditions of a sincere repentance which we have clarified in Fatwa 86527.
As regards your daughter, she is traced back to your husband, as he is the owner of the bed; her tracing back to him is confirmed as long as he does not deny her with Li’aan (i.e. he and his wife invoke the curse of Allaah on the liar among them when he accuses her of having committed adultery). For details, please refer to Fataawa 88978and 84301.
It should be noted here that among the conditions of Li’aan is that it should be done immediately, so if the husband has sexual intercourse with his wife or he delays the Li’aan after him knowing about the pregnancy or the delivery without an excuse, then the Li’aan in this case is not valid.
As regards the doubts that you have about your daughter thinking that she is not from your husband, then you should ignore them.
Besides, your husband being deprived of male children does not mean that this is because Allaah is angry with you, it might be just a kind of trial. Also, the fact that you have committed Zina (adultery) does not necessarily mean that it will have a bad effect on your life or your husband's life. So, you should avoid these whispers as the devil may use them to prevent you from what benefits you in your religion as well as in your worldly matters.
On the other hand, if the matter is as you mentioned that your husband calls your daughter ‘a bastard’ (an illegitimate child), then this is a great evil as he should not call her so, because she is legitimately his daughter unless he denies her with Li’aan as we have already clarified.
However, along with repentance, you are obliged to conceal your sin of Zina and not inform anyone about it, be it your husband or anyone else. You should preserve your chastity with Hijab and avoiding being in seclusion with non-Mahram (marriageable) men, and other means of temptation. Also, you should seek beneficial knowledge, perform good deeds, and keep company with pious Muslim sisters.
Finally, urging your husband to marry a second wife is a good thing, but it seems that you think that you are obliged to help him marry another wife so that it will be an expiation for your sin, but the matter is not so as you are not obliged to help him marry a second wife. For more benefit, please refer to Fataawa 81469 and 88728.
Allaah Knows best.