In this paper we present a methodology to measure the energy consumption of software. The methodology is based on detailed monitoring of power usage of hardware components. We explain our lab setup after which we apply the methodology to different pieces of DNS resolver software. Through this case study we demonstrate some of the uses of our methodology, as it can be used to determine which software performs the tasks at hand in the most energy efficient way, what the influence of software configuration can be, etcetera.