Dengue virus (DENV) is associated with an estimated 390 million infections per year, occurring across approximately 100 countries in tropical and sub-tropical regions. To date, there are no antiviral drugs or specific therapies to treat DENV infection. Posaconazole and itraconazole are potent antifungal drugs that inhibit ergosterol biosynthesis in fungal cells, but also target a number of human proteins. Here, we show that itraconazole and posaconazole have antiviral activity against DENV. Posaconazole inhibited replication of multiple serotypes of DENV and the related flavivirus Zika virus, and reduced viral RNA replication, but not translation of the viral genome. We used a combination of knockdown and drug sensitization assays to define the molecular target of posaconazole that mediates its antiviral activity. We found that knockdown of oxysterol-binding protein (OSBP) inhibited DENV replication. Moreover, knockdown of OSBP, but not other known targets of posaconazole, enhanced the inhibitory effect of posaconazole. Our findings imply OSBP as a potential target for the development of antiviral compounds against DENV.