I was sitting with Ibn Abbas when a man came to him and said, "It is you?" He then mentioned a distant kinship he had with him, and Ibn Abbas spoke gently to him.Ibn Abbas said, "The Messenger of Allah ﷺ said, 'Learn your lineages so that you may maintain your ties of kinship, for there is no closeness in kinship when it is severed, even if the relation is near, and there is no distance in it when it is upheld, even if the relation is far.'"
كنت عند ابن عباس، فأتاه رجل فقال: أنت؟ فمت له برحم بعيدة، فألان له القول، فقال: قال رسول الله ﷺ اعرفوا أنسابكم تصلوا أرحامكم؛ فإنه لا قرب بالرحم إذا قطعت، وإن كانت قريبة، ولا بعد بها إذا وصلت، وإن كانت بعيدة.
No references are available.
Abu Dawud Tayalisi (2880) narrated it from Ishaq bin Saeed, who said, "My father told me the hadith," and then he related it.Hakim graded it sahih (1/89), narrating it through the route of Tayalisi, with the same wording. He then said, "Sahih according to the criteria of the two Shaykhs." Hafiz also graded it sahih in Matalib Aliyah (2519).