Call them by [the names of] their fathers; it is more just in the sight of Allah. But if you do not know their fathers – then they are [still] your brothers in religion and those entrusted to you. And there is no blame upon you for that in which you have erred but [only for] what your hearts intended. And ever is Allah Forgiving and Merciful.
Narrated `Abdullah bin `Umar:
We used not to call Zaid bin Haritha the freed slave of Allah's Messenger (sallallaahu alayhi wa sallam) except Zaid bin Muhammad till the Qu'anic Verse was revealed: "Call them (adopted sons) by (the names of) their fathers. That is more than just in the Sight of Allah." [Qur’aan 33.5]
[Sahiih al-Bukhaari Hadiith No. 4782]
Narrated Abu Huraira:
The Prophet (sallallaahu alayhi wa sallam) said, "Do not deny your fathers (i.e. claim to be the sons of persons other than your fathers), and whoever denies his father, is charged with disbelief."
[Sahiih al-Bukhaari Hadiith No. 6768]