Default How to backup the current default rom?

I want to root the phone but before that I would like to backup the current rom as in case if need to send the phone for warranty purpose than I can just fash back the stock rom.

Please guide.