In my strong but humble opinion I believe it is best for the child that "custody of the child" be formalized via a court order naming the father just like it names the mother and the child's birth certificate carries his last name. It is best for the protection of the child now and in the future and even extends to his children. There are many reasons.
Further, an attorney (officer of the court) or another spouse can not restrain parents in any way without just cause and a legitimate judical process. Defacto custody is for the party providing primary responsible care of children. Likewise a support order and marital status does not determine parentage..... wait a minute .... some states tags the mother's husband as the father absent DNA.