Disclaimer: These are silly little pranks, but I don't encourage messing with someone's computing environment without letting them know you have done so.
I have a friend who really likes to read people.com, so I figured I would "enrich" her life a bit with another source of daily news :)
I decided to play around with her hosts file, so that when she visited people.com, she really got the New York Times (the realest news I could think of at that time, though there are plenty of fine candidates).
To quote the Wikipedia article on
The hosts file...assists in addressing network nodes in a computer network. It is a common part of an operating system's Internet Protocol (IP) implementation, and serves the function of translating human-friendly hostnames into numeric protocol addresses, called IP addresses, that identify and locate a host in an IP network.
/etc/hostsfile...allows you to add entries that traditionally your computer will look up first before trying your server DNS.
This means that even though the
DNS Lookup provided by her
people.com, her browser would get an
IP address from the hosts file
first and hence will render the New York Times page for
The first step to do this was to find the IP address for the replacement site:
$ ping www.nytimes.com PING www.nytimes.com (220.127.116.11): 56 data bytes 64 bytes from 18.104.22.168: icmp_seq=0 ttl=64 time=0.062 ms 64 bytes from 22.214.171.124: icmp_seq=1 ttl=64 time=0.054 ms ...
For the second (and final) step, I just needed to add an entry to the
hosts file. After
the file on her Macbook in
/etc/hosts, I updated the contents:
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost 126.96.36.199 people.com # New entry