I have installed and started dnsmasq, using brew install dnsmasq and sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist respectively. I tried to use the "adress" function inside dnsmasq.conf and added this as an example:
address=/.facebook.com/127.0.0.1
However, accesing facebook from my browser does not send me to localhost. I also tried starting it and specifying the conf file, but it's in the default path anyway.
It might also be that it doesn't work at all, but there is no way to tell.