How to convert a linear dicarboxylate species to the dimethyl ester?

I was wondering about the *ozonolysis* of *cyclohexane* and further treatment with $\ce{H2O2}$. I understand that the product to this reaction is *hexanedioic acid*.


How could we substitute the $\ce{-H}$ on each carboxylic group to a methyl, as in the following structure:


[![enter image description here](https://i.stack.imgur.com/JSwuZm.png)](https://i.stack.imgur.com/JSwuZm.png)


I am pretty sure it would be by adding two moles of *methanol* (Fischer esterification). Is this procedure correct?




You have a couple of options. 


* Your acid-catalyzed *Fisher* esterification is one of them. The downside is that water, which is liberated in the reaction, has a higher boiling point than methanol. You can't just destill it off to drive the reaction to completion.
* *Zhe* and *Hexacoordinate-C* mentioned diazomethane and methyl iodide which might work well. You might want to make sure that your DNA does not get methylated.
* The *Steglich* esterification, using dicyclohexylcarbodiimide (DCC) and N,N'-dimethylaminopyridine (DMAP) might be an alternative to the *Fisher* esterifiction.
* You might want to try something different, using dimethyl carbonate as a non-cancerogenic alkylation reagent. The procedure is described in [*Green Chemistry Letters and Reviews*, **2013**, *61*, 89-93](http://dx.doi.org/10.1080/17518253.2012.706647) and uses potassium carbonate as a base, dimethyl carbonate as a reagent (and solvent), and tetrabutylammonium chloride as a catalyst.


 4