In Malaysia, the government and higher education institutions have introduced various policies and plans regarding online learning. When the Coronavirus disease (COVID-19) pandemic hit the world in 2019, the government implemented the Movement Control Order (MCO) starting on March 18, 2020. Consequently, Malaysian higher education institutions fully utilized online learning platforms such as Zoom, Microsoft Teams, Webex Blackboard, and Google Classroom in order to sustain the continuity of teaching and learning during the pandemic. Therefore, the main objective of this study is to determine the influence of community of inquiry (social presence, cognitive presence, and teaching presence) on knowledge building in online learning among undergraduate students in Malaysian public universities during the COVID-19 pandemic. This study adopted a correlational research design and was conducted at Malaysian public universities. The sample was selected based on the proportional stratified sampling method, and the recommended sample size for this study was 367. Statistical descriptive analysis discovered that knowledge building and community of inquiry were more inclined. From the direct effect of Structural Equation Model (SEM) analysis, the community of inquiry insignificantly effect knowledge building in online learning (β = 0.072; C.R. = 0.647; p = 0.517). Hence, future studies can compare the findings from different scholars in Malaysian and overseas contexts. This study offered an integrated, coherent, and actionable framework covering a variety of constructs in the context of online learning during a pandemic. In addition, it also provided insight for universities as to where future efforts need to be directed, especially in the areas related to the improvement of the facilities and infrastructure for online learning implementation.