Sefer Hachasidim Chapter 232 - "There was an incident with the sage R. Saadia ben Yosef the sage, with one who went to a faraway country with his servant with a lot of money, and his wife was pregnant, after a while he died and left all the money [to his son] and the servant seized his assets and claimed to be the late man's son. When the son grew up, he heard that his father died, he went to claim his property which the servant had seized (and the servant had married into an influential family) and the son was afraid to make his claim lest they kill himand he visited Rav Saadia's house and was given food to eat but he refused to eat until he laid out this situation. Rav Saadia gave him advice to tell the king and he did. The king sent Rav Saadia to judge this case. He commanded to take this man's blood into one container, and and the other man's blood into another container, and they took a bone [from the dead man] and stuck it into the container with the servant's blood, and the blood was not absorbed [in the bone] and they took the bone and stuck it into the container with the son's blood and the blood was absorbed in the bone because they were "one body" and Rav Saadia took the money and gave it to the son."
Rashash, Bava Basra 58a explains the incident of R. Bnah (see previous post) using this Sefer Hachasidim. R' Bnah didn't have them beat the grave, but do this "blood test." Rashash uses this explanation to answer Eliyahu Rabah, Orach Chaim 568:15. He also points out that with this discreet method, R. Bnah ensured people did not realize that the other sons in this case were mamzeirim.
Rav S.Y. Zevin in Le'or HaHalakha (Tel Aviv: Abraham Zioni, 1957, p. 195) says that this is the basis for genetic testing in Halakha.
The method used was obviously very crude, as it was at least 1000 years ago. Our DNA tests are very different. The main idea to take from this Sefer Hachasidim is that there is a method to establish paternity that is not based on testimony of witnesses. (DNA might also be used to determine the indentity of burn victims or other corpses where other methods of identification - including fingerprints and dental records, though there is also discussions whether those are halachikly acceptible means of identification - may not be available.) One could combine the Meiri and Rashash and say that only extremely wise sages can use this method, but I think that is unlikely.
The Sefer Hachasidim arranged by R. Shimon Gutman (Jerusalem: Otzar Haposkim, 2007) mentions that R. Shlomo Zalman Auerbach zt"l did not accept genetic testing to determine paternity/maternity from 2 sources: Mishnas Avraham E"H p.30 (Lev Avraham Volume 2 page 17) and the journal Assia 35 (Shevat 5743/January 1983) p. 52. I have heard from reliable sources that R. Yosef Sholom Elyashiv Shlit"a also does not accept genetic testing as acceptible proof.
See, however, Hilchos Aveilus, Madrich Mefurat (Third edition) by Yitzchak Ushinksky (Jerusalem: Otzar Haposkim, 2005) siman 12 and 13 about the use of DNA evidence, and he mentions rulings by R. S. Wozner and R. Z.N. Goldberg (see Tchumin 23) who discusses using DNA evidence for various determinations. (These 2 simanim were also published in Kulmus, Mishpacha Magazine Shevat 5764 and Tchumin 24, respectively.) I happened to notice last week that R. Chaim Regensberg in Mishmeres Chaim (Jerusalem: Chicago Rabbinical Council, 1966) says that when fingerprints and blood tests are unequivocal, they are accepted by Beis Din.