Section 600B.40 - Custody and visitation1. The mother of a child born out of wedlock whose paternity has not been acknowledged and who has not been adopted has sole custody of the child unless the court orders otherwise. If a judgment of paternity is entered, the father may petition for rights of visitation or custody in the same paternity action or in an equity proceeding separate from any action to establish paternity.2. In determining the visitation or custody arrangements of a child born out of wedlock, if a judgment of paternity is entered and the mother of the child has not been awarded sole custody, section 598.41 shall apply to the determination, as applicable, and the court shall consider the factors specified in section 598.41, subsection 3, including but not limited to the factor related to a parent's history of domestic abuse.3. In a proceeding under this chapter to determine custody or visitation or to modify a custody or visitation order, section 598.15 shall apply to the parties.4. The court may order the appointment of a guardian ad litem or attorney for a child, a child custody investigator, or a child and family reporter consistent with the provisions of sections 598.12, 598.12A, and 598.12B.