كتاب الصيام
13  
The Book of Fasting
(15)
Chapter: It is permissible to fast or not to fast during Ramadan for one who is travelling for no sinful purpose, if his journey is two stages or further. But it is better for the one who is able to fast without suffering any harm to do so, and the one for whom it is difficult may break the fast
(15)
باب جواز الصوم والفطر في شهر رمضان للمسافر في غير معصية إذا كان سفره مرحلتين فأكثر وأن الأفضل لمن أطاقه بلا ضرر أن يصوم ولمن يشق عليه أن يفطر
Sahih Muslim 1113 a

Ibn Abbas (Allah be pleased with him) reported that the Messenger of Allah (ﷺ) went out during the month of Ramadan in the year of Victory (when Mecca was conquered) and was fasting till he reached Kadid (a canal situated at a distance of forty-two miles from Mecca) and he then broke the fast. And it was the habit of the Companions of the Messenger of Allah (ﷺ) to follow him in every new thing (or act). So they followed him also (in this matter).

حَدَّثَنِي يَحْيَى بْنُ يَحْيَى، وَمُحَمَّدُ بْنُ رُمْحٍ، قَالاَ أَخْبَرَنَا اللَّيْثُ، ح وَحَدَّثَنَا قُتَيْبَةُ بْنُ، سَعِيدٍ حَدَّثَنَا لَيْثٌ، عَنِ ابْنِ شِهَابٍ، عَنْ عُبَيْدِ اللَّهِ بْنِ عَبْدِ اللَّهِ بْنِ عُتْبَةَ، عَنِ ابْنِ عَبَّاسٍ، - رضى الله عنهما - أَنَّهُ أَخْبَرَهُ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم خَرَجَ عَامَ الْفَتْحِ فِي رَمَضَانَ فَصَامَ حَتَّى بَلَغَ الْكَدِيدَ ثُمَّ أَفْطَرَ وَكَانَ صَحَابَةُ رَسُولِ اللَّهِ صلى الله عليه وسلم يَتَّبِعُونَ الأَحْدَثَ فَالأَحْدَثَ مِنْ أَمْرِهِ ‏.‏
Reference : Sahih Muslim 1113a
In-book reference : Book 13, Hadith 110
USC-MSA web (English) reference : Book 6, Hadith 2466
  (deprecated numbering scheme)