Insomnia disorder has been associated with poor executive functioning. Functional imaging studies of executive functioning in insomnia are scarce and inconclusive. Because the Attentional Network Test relies on well-defined cortical networks and sensitively distinguishes different aspects of executive function, it might reveal brain functional alterations in relatively small samples of patients. The current pilot study assessed functional connectivity during the Attentional Network Test performed using magnetic resonance imaging in 12 participants with insomnia and 13 self-defined good sleepers. ANCOVAs were used to evaluate group differences in performance and functional connectivity in the regions of interest representing the attentional networks (i.e. alerting, orienting and executive control) at p < 0.05, uncorrected. During the orienting part, participants with insomnia showed weaker connectivity of the precentral gyrus with the superior parietal lobe (false discovery rate-corrected), while they showed stronger connectivity between premotor and visual regions. Individual differences in connectivity between premotor and visual regions correlated inversely with reaction time. Reaction times suggested more efficient executive control in participants with insomnia compared with good sleepers. During the executive control part, participants with insomnia showed stronger connectivity of thalamic parts of the arousal circuit with the middle frontal and the occipital gyri. Conversely, connectivity between the inferior and superior frontal gyri was weaker. Participants with insomnia seem to recruit more cortical resources in visuo-motor regions to orient attention than good sleepers do, and seem to have enhanced executive control that relates to stronger connectivity of arousal-related thalamic areas. This latter result should be treated with caution and requires confirmation.