What should you do if your ex husband knows the judge and was granted custody when he has never had a relationship with your daughter?

Go back to your lawyer and start the process again. The judge has to do his job and should have behaved proffessionally. Make sure you get lawyer for child who will act in the best interests of your child. Keep records of all conversations and visitations your child has with the Dad. Good luck!!