Hadith 1502

حَدَّثَنَا إِبْرَاهِيمُ بْنُ الْمُنْذِرِ ، حَدَّثَنَا الْوَلِيدُ ، حَدَّثَنَا أَبُو عَمْرٍو الْأَوْزَاعِيُّ ، حَدَّثَنِي إِسْحَاقُ بْنُ عَبْدِ اللَّهِ بْنِ أَبِي طَلْحَةَ ، حَدَّثَنِي أَنَسُ بْنُ مَالِكٍرَضِيَ اللَّهُ عَنْهُ , قَالَ : " غَدَوْتُ إِلَى رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ بِعَبْدِ اللَّهِ بْنِ أَبِي طَلْحَةَ لِيُحَنِّكَهُ ، فَوَافَيْتُهُ فِي يَدِهِ الْمِيسَمُ يَسِمُ إِبِلَ الصَّدَقَةِ " .
Narrated Anas bin Malik: I took `Abdullah bin Abu Talha to Allah's Apostle to perform Tahnik for him. (Tahnik was a custom among the Muslims that whenever a child was born they used to take it to the Prophet who would chew a piece of date and put a part of its juice in the child's mouth). I saw the Prophet and he had an instrument for branding in his hands and was branding the camels of Zakat.
Hadith Reference صحيح البخاري / كتاب الزكاة / 1502
Hadith Grading محدثین: أحاديث صحيح البخاريّ كلّها صحيحة
Explanation & Benefits
Maulana Dawood Raz
Hadith Commentary:
It is understood from this that branding an animal out of necessity is permissible, and this refutes the position of the Hanafis who have considered branding to be disliked (makruh) and have regarded it as mutilation (muthlah). (Wahidi)

And performing tahnik for children is also a Sunnah, that is, to chew a date or some other thing with the mouth of a pious person and place it in the mouth of the child, so that the child may also acquire a good nature.
Source: Sahih Bukhari: Commentary by Maulana Dawood Raz, Page: 1502
Shaykh Abdul Sattar al-Hammad
Hadith Commentary:
(1)
It is mentioned in the hadith that the Messenger of Allah (sallallahu alayhi wa sallam) forbade causing unnecessary pain to animals and mutilating them, but branding an animal for a valid need is permissible. This is an exceptional case; the benefit of branding them is that they can be distinguished from other animals. Furthermore, if someone steals or drives them away, it becomes easier to reclaim them. Another benefit is that if a marked animal is being sold, the one who gave it in charity will know, so that he does not end up buying it and thus become guilty of taking back his charity. (Fath al-Bari: 3/462)

(2)
This hadith also proves that giving tahnik (chewing something and placing it in the mouth of a newborn) to children is a Sunnah. However, the attainment of blessing (barakah) is specific only to the Messenger of Allah (sallallahu alayhi wa sallam), so anyone can perform tahnik for a child. Nevertheless, as a good omen, there is no harm in having a pious person perform the tahnik, but one should avoid unnecessary formality in this matter. There are also several medical benefits to it, and there is no harm in purchasing tahnik from the market and using it. And Allah knows best.
Source: Hidayat al-Qari: Commentary on Sahih Bukhari, Urdu, Page: 1502