Catalyzes the oxidation of D-2-hydroxyglutarate (D-2-HG) to alpha-ketoglutarate (PubMed:15070399, PubMed:15609246, PubMed:16037974, PubMed:20020533, PubMed:33431826). Also catalyzes the oxidation of other D-2-hydroxyacids, such as D-malate (D-MAL) and D-lactate (D-LAC) (PubMed:33431826). Exhibits high activities towards D-2-HG and D-MAL but a very weak activity towards D-LAC (PubMed:33431826). (R)-2-hydroxyglutarate + A = 2-oxoglutarate + AH2 (R)-malate + A = AH2 + oxaloacetate Activated by zinc and cobalt ions. The disease is caused by variants affecting the gene represented in this entry. Belongs to the FAD-binding oxidoreductase/transferase type 4 family.