The DNA test as we know it today is a very recent development. It only became available around three decades ago, giving families & lawmakers at last, a solid, accurate, and scientific way to prove who is the father of a child.
As for the other 350,000 years of human history—paternity was somewhat of a mystery, with no reliable method of proving who was who's dad. Of course that didn't stop some people from trying.
The earliest known paternity dispute
One of the very earliest paternity disputes that we know of was the legend of St. Anthony, the 12th Century priest. St. Anthony was approached by a distraught woman and her jealous husband—who believed that his newborn son wasn't his, but was the result of adultery. According to the legend, the priest asked the baby who his real father was, and the baby miraculously answered, pointing to the husband and replying "that is my father."
Similar stories and legends are repeated throughout history. Knowing a baby's maternity may be easy, but for many hundreds of years people have struggled to find a reliable way to prove the identity of a baby's father.
Scientists (and pseudo-scientists) of the 19th and early 20th centuries were desperate to find a scientifically-accurate way to prove paternity. Some of the testing methods that came from that time were on the right track, whilst others were completely ludicrous.
One infamous example was Dr. Albert Abrams and his Oscillophore—a bizarre medical device that, he claimed, could measure the precise electronic vibrations in droplets of blood. His theory goes that the blood of different ethnic groups vibrated at different frequencies. Irish blood for example, vibrated at 15 ohms. Of course his claims were ridiculous (and had racist connotations), but it didn't stop the Oscillophore from capturing the public imagination for a time.
Another questionable method was the idea that you could measure the pattern of ridges in the roof of a person's mouth to prove paternity, as some believed the patterns were inherited from the father.
Early paternity tests
The first 'real' attempt at proving paternity came in the 1930s with the advent of "blood grouping"—or what we know today as "blood types." Scientists realised that people had different blood groups, and that these groups were hereditary. For example, if baby has blood type AB, and its mother is type A, the father must be either type B or AB.
This method couldn't conclusively prove who is the father, but it could rule out someone who definitely isn't. It was famously used against Charlie Chaplin in the 1940s by his ex-wife Joan Berry, who alleged that Chaplin was the father of her newborn daughter. The blood test conclusively proved that Chaplin could not be the baby's father.
DNA testing today
The modern DNA test, which was developed in the 1980s and really caught-on in the 90s, removes all of the guess work. A reputable testing company can perform a paternity test with over 99.99 percent accuracy. With today's technology, a test costs around $100-150, and the results can be sent out the next day.
While a paternity test can determine a biological father, it doesn't answer the more difficult philosophical question of "what is a father?" Going back to the Charlie Chaplin case—although the test proved that he wasn't the child's biological parent, the jury still decided that Chaplin was the father—socially speaking, if not scientifically speaking.
As history professor and author of Paternity: The Elusive Quest for the FatherNara Milanich puts it:
"Who as a society do we want fathers to be? That's not something a geneticist can solve."