Did you know that a DNA match to your child isn't necessarily a guarantee that you're the parent? There are very few exceptions when that happens, but it can and does occur.
Paternity fraud happens, and it's normal for some people to believe that a man is the father of their child when he is not. However, there are extreme cases where a mother might submit the DNA of the possible father's biological child instead of the newborn, resulting in a positive result when there may not have been one otherwise. Similarly, a man might swamp out his DNA for someone else's to avoid paternity.
On top of fraud, there is the unusual chance that a child might be a person's twin brother's child. Twins share DNA, so it's perfectly possible to get a positive paternity test but to later find out that the true father was the sibling of the person said to be the biological parent. False positives have occurred with grandfathers and grandsons, uncles and nephews, fathers, sons and brothers.
DNA testing is usually submitted by the people involved in a case. That means that you and your ex-wife, wife, girlfriend or partner will submit your own samples. If you want to guarantee accurate results in around 99% of cases, you'll ask a disinterested witness to handle the DNA sample collection. Doing that helps guarantee that you and your child's biological mother both submit DNA samples from appropriate sources.
DNA is not as simple as it seems. If you need a paternity test, make sure you get it done through the right legal channels.