Very tiny suggestion to use nano for newbies. :) It's a much simpler editor and the commands are right there on the bottom (CTRL-X to save&exit). I use vi, myself, but if you're not familiar with or literate on Unix platforms, nano (formerly pico) is the way to go:
nano dnsmasq.conf