Hyperadrenocorticism (HAC) is a common endocrine disorder in dogs, which is associated with diverse metabolic abnormalities. We hypothesized that elevated cortisol levels in dogs with HAC disrupt the gut microbiome (GM), and this disruption persists even after trilostane treatment. This study explored GM composition in dogs with HAC. We included 24 dogs, 15 with HAC and 9 healthy controls, and followed up with 5 dogs with HAC who received trilostane treatment. The GM analysis revealed significant compositional changes in dogs with HAC, including reduced microbiome diversity compared to healthy controls, particularly in rare taxa, as indicated by the Shannon index (p = 0.0148). Beta diversity analysis further showed a distinct clustering of microbiomes in dogs with HAC, separating them from healthy dogs (p < 0.003). Specifically, an overrepresentation of Proteobacteria (Pseudomonadota), Actinobacteria, Bacteroides, Enterococcus, Corynebacterium, Escherichia, and Proteus populations occurred alongside a decreased Firmicutes (Bacillota) population. Despite trilostane treatment, gut dysbiosis persisted in dogs with HAC at a median of 41 d post treatment, suggesting its potential role in ongoing metabolic issues. We identified GM dysbiosis in dogs with HAC by examining key bacterial genera, offering insights into potential interventions like probiotics or fecal microbiota transplants for better HAC management.