How to edit the hosts to block IP address?
Technically, OS X can make use of /etc/hosts.allow and /etc/hosts.deny files that will  work with standard resolvable hostnames. For blocking IP addresses, using iptables is the usual method but apparently Apple deprecated its use beginning with Lion and switched to pf for this function. Check and read the links in this thread on SuperUser for info on using pf and perhaps a GUI front-end for it.