Abu Dawud Book 1, Hadith Number 9.
Chapter : Disapproval of facing the qibla while releiving oneself.
Narated By Abu Ayyub : The Holy Prophet (PBUH) said: “When you go to the privy, neither turn your face nor your back towards the qibla at the time of excretion or urination, but turn towards the east or the west. (Abu Ayyub) said: When we came to syria, we found that the toilets already built were facing the qiblah. We turned our faces away from them and begged pardon of Allah.