Abu Dharr reported,

Ubayy heard the Prophet ﷺ say, "Any man who knowingly claims someone other than his real father as his father has committed disbelief, and whoever claims to belong to a people to whom he has no lineage, let him take his seat in the Fire."

Azami 201

Sahih

عن أبي ذر

أنه سمع النبي ﷺ يقول: ليس من رجل ادعى لغير أبيه- وهو يعلمه- إلا كفر، ومن ادعى قوما ليس له فيهم فليتبوأ مقعده من النار.

الأعظمي 201صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Qualities of faith
Section
Clarification of the state of faith of one who disowns his father knowingly
Numbering
Jami al-Kamil 201 (2nd edition)
Azami 201