I myself did not know him, but for this purpose I came baptizing with water, that he might be revealed to Israel.” (John 1:31, ESV)This passage is a bit more interesting than one might think. John Calvin goes into great detail on the thought of whether or not John knew that Jesus was the Christ or not. It seems to make sense that he would know who he was. Not only was there some relation between their mothers, but we also see (from the other gospels) that when Jesus goes to get baptized by John, John attempts to reject the thought outright because of his unworthiness. Jesus has to reassure him that it had to be that way, and then after the baptism we see the Spirit of God descending on Jesus. In John's account, John the Baptist identifies Christ through the sign of the Baptism. How do these two things work together?
John Calvin tells us that John the Baptist knew who Jesus was, but the Baptism sign offered John a sign to point to for others. I believe that they call it an a priori argument, or possibly an a posteriori argument. Either way, John the Baptist most likely knew who Jesus was, but the sign solidified the claim so that John could say that Jesus was the Christ because God had revealed it to him through a sign.