Distraction reflects a drift of attention away from the task at hand towards task-irrelevant external or internal information (mind-wandering). The right posterior parietal cortex (PPC) and the medial prefrontal cortex (mPFC) are known to mediate attention to external information and mind-wandering, respectively, but it is not clear whether they support each process selectively or rather they play similar roles in supporting both. In this study, participants performed a visual search task including salient color singleton distractors before and after receiving cathodal (inhibitory) transcranial direct current stimulation (tDCS) to the right PPC, the mPFC, or sham tDCS. Thought probes assessed the intensity and contents of mind-wandering during visual search. The results show that tDCS to the right PPC but not mPFC reduced the attentional capture by the singleton distractor during visual search. tDCS to both mPFC and PPC reduced mind-wandering, but only tDCS to the mPFC specifically reduced future-oriented mind-wandering. These results suggest that the right PPC and mPFC play a different role in directing attention towards task-irrelevant information. The PPC is involved in both external and internal distraction, possibly by mediating the disengagement of attention from the current task and its reorienting to salient information, be this a percept or a mental content (mind-wandering). By contrast, the mPFC uniquely supports mind-wandering, possibly by mediating the endogenous generation of future-oriented thoughts capable to draw attention inward, away from ongoing activities.