كتاب الطهارة
1  
The Book of Purification
(21)
Chapter: The Command To Face Toward The East Or The West When Relieving Oneself
(21)
باب الأَمْرِ بِاسْتِقْبَالِ الْمَشْرِقِ أَوِ الْمَغْرِبِ عِنْدَ الْحَاجَةِ ‏‏
Sunan an-Nasa'i 22
It was narrated that Abu Ayyub Al-Ansari said:
"The Messenger of Allah (ﷺ) said: 'When any one of you goes to defecate, let him not face toward the Qiblah, rather let him face towards the east or the west.'"
أَخْبَرَنَا يَعْقُوبُ بْنُ إِبْرَاهِيمَ، قَالَ أَنْبَأَنَا غُنْدَرٌ، قَالَ أَنْبَأَنَا مَعْمَرٌ، قَالَ أَنْبَأَنَا ابْنُ شِهَابٍ، عَنْ عَطَاءِ بْنِ يَزِيدَ، عَنْ أَبِي أَيُّوبَ الأَنْصَارِيِّ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ إِذَا أَتَى أَحَدُكُمُ الْغَائِطَ فَلاَ يَسْتَقْبِلِ الْقِبْلَةَ وَلَكِنْ لِيُشَرِّقْ أَوْ لِيُغَرِّبْ ‏"‏ ‏.‏
Grade: Sahih (Darussalam)
Reference : Sunan an-Nasa'i 22
In-book reference : Book 1, Hadith 22
English translation : Vol. 1, Book 1, Hadith 22