You may execute a reverse DNS lookup to determine a hostname you want to block.
Use a web service like reverse DNS lookup or 'nslookup' to get a hostname.
nslookup:
- Start
Terminal.app
and enter nslookup
- At the prompt enter
server 8.8.8.8
(this defines which dns-server to use to do the reverse DNS lookup. 8.8.8.8 is a google name server)
- At the next prompt enter an ip-address
- Now you'll get the host name you need for your
hosts
file
Example output:
user$ nslookup
> server 8.8.8.8
Default server: 8.8.8.8
Address: 8.8.8.8#53
> 93.220.102.55
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
55.102.220.93.in-addr.arpa name = p5DDC6637.dip0.t-ipconnect.de.
If you add 127.0.0.1 p5DDC6637.dip0.t-ipconnect.de
to your hosts
file you will prevent your computer accessing my web server.
Caveats:
A lot of ip-addresses and correspondent host names can't be tied to a special computer/host. Mine change at least every 24 hours.
A today hazardous site/hostname might be a valuable one in the future but unaccessible for you.
Some ip-addresses are tied to several hostnames with the consequence that you won't be able to detect the name you actually want to block.