Birth certificate help

Can anyone give insight on how a birth certificate will work when wanting to do a paternity test?

EDIT: I should’ve been more specific.

What if the results aren’t in before the baby and I leave the hospital?

Does the baby have to take my last name until the results are back?

Does the hospital do this or do I need to bring in an outside company?