Paternity?

Not sure if any of you ladies know about paternity laws/rules, but I wanted to ask just in case. I became pregnant during a break from my boyfriend by another guy. I've since worked everything out with my SO and we're now married. What I want to know is will the baby take my husband's last name or the father's last name? Will it change after paternity is determined? No judgement please.