Opting out of Omniture’s 192.168.112.2o7.net, the geeky way

I’ve been following the news on Daring Fireball about Omniture’s sneaky use of the 192.168.112.2o7.net domain name in phone-home functionality used by iTunes, Adobe CS3 apps and (presumably) others.

Mitcho.com notes that you can opt out of 2o7.net tracking, but only by setting a browser cookie, which won’t have any effect within apps such as iTunes and Photoshop CS3. That site suggests a third-party solution for preventing apps from connecting to Omniture’s servers. But there is a simpler (and free!) way, at least on OS X.

Like most Unix and Unix-like OSs, Mac OS X has a file that maps domain names to IP addresses, /etc/hosts. The OS looks in this file first when it needs to translate a domain name, before hitting your DNS server - so you can consider it a very crude highest-priority local DNS server. /etc/hosts is dead handy for assigning simple names to machines on your local network with static IP addresses. Mine currently looks like this:

##
# 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
10.0.0.11       imac
10.0.0.5        penguin
10.0.0.1	router

The format is simple:

<ip address> <domain_name> [<domain name> ...]

The essence of this trick is: we’re going to add a new domain name (192.168.112.2o7.net) that points to the localhost entry.

How to edit the hosts file is outside the scope of this article, but typically you’ll need to open a Terminal window and type:

$ sudo editor /etc/hosts

where editor is your text editor of choice. If you’ve never used a command-line text editor before and want something easy, use pico (sudo pico /etc/hosts). If you have TextMate and the mate shell command installed you can use that (sudo mate /etc/hosts). You should probably make a backup of /etc/hosts before you edit it, just in case - you can do that with:

$ sudo cp /etc/hosts /etc/hosts.backup

So I’ve changed my /etc/hosts file to resolve the domain name 192.168.112.2o7.net to 127.0.0.1 - the localhost “loopback” address, which always points to the local machine:

##
# 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 192.168.112.2o7.net
255.255.255.255  broadcasthost
::1              localhost
fe80::1%lo0      localhost
10.0.0.11        imac
10.0.0.5         penguin
10.0.0.1         router

Now when an app tries to phone home to 192.168.112.2o7.net, it’ll be connecting to the local host instead of Omniture’s server. This will typically result in an error response, which the app should silently ignore.

To confirm that the redirection works as expected, I saved my changes to /etc/hosts, opened a new Terminal window and used traceroute:

$ traceroute 192.168.112.2o7.net
traceroute to localhost (127.0.0.1), 64 hops max, 40 byte packets
 1  localhost (127.0.0.1)  0.387 ms  0.039 ms  0.032 ms

Problem solved!

Incidentally, Windows has a similar IP-to-domain-name mapping file - last time I used Windows I think it was in C:\Windows\System32\drivers\etc or somewhere odd like that - again the file is called hosts. Sadly my legitimate and very expensive copy of Vista is having activation issues so I can’t confirm this. Grrr!

3 comments ↓

#1 dvsjr on 12.31.07 at 2:34 am

Nicely done, and a simple way to fix this ridiculous problem.

#2 Damien McKenna on 01.02.08 at 1:48 pm

Is there any reliable way to block the entire 2o7.net domain in case they just change the hostname?

#3 Paul O on 01.04.08 at 2:34 am

Go to http://someonewhocares.org/hosts/ & follow the instructions.

All the 2o7.net IPs are listed.