The objective of this study was to investigate the effect effect of varying roughage and concentrate proportions, in diet of crossbreed dairy cattle, on the composition and associated functional genes of rumen and fecal microbiota. We also explored fecal samples as a proxy for rumen liquor samples. Six crossbred dairy cattle were reared on three diets with an increasing concentrate and reducing roughage amount in three consecutive 10-day periods. After each period, individual rumen liquor and fecal samples were collected and analyzed through shotgun metagenomic sequencing. Average relative abundance of identified Operational Taxonomic Units (OTU) and microbial functional roles from all animals were compared between diets and sample types (fecal and rumen liquor). Results indicated that dietary modifications significantly affected several rumen and fecal microbial OTUs. In the rumen, an increase in dietary concentrate resulted in an upsurge in the abundance of Proteobacteria, while reducing the proportions of Bacteroidetes and Firmicutes. Conversely, changes in microbial composition in fecal samples were not consistent with dietary modification patterns. Microbial functional pathway classification identified that carbohydrate metabolism and protein metabolism pathways dominated microbial roles. Assessment of dietary effects on the predicted functional roles of these microbiota revealed that a high amount of dietary concentrate resulted in an increase in central carbohydrate metabolism and a corresponding reduction in protein synthesis. Moreover, we identified several microbial stress-related responses linked to dietary changes. Bacteroides and Clostridium genera were the principal hosts of these microbial functions. Therefore, the rhoughage to concentrate proportion has more influence on the the microbial composition and microbial functional genes in rumen samples than fecal samples. As such, we did not establish a significant relationship between the rumen and fecal metagenome profiles, and the rumen and fecal microbiota from one animal did not correlate more than those from different animals.