How to block ads or annoying services like Tynt in any browser, on any computer -- without additional software
All you have to do to block ads, Tynt, or even Facebook from ever bothering you again is to add their hostnames to your computer's hosts file. The best thing about this is that you can do it whether you're using a Windows PC, Mac, or Linux. They've all got hosts files, and power-users have been using them for years to speed up browsing or block ad networks. As an example of using the hosts file as a system-wide ad-blocker, check out this list of ad network hostnames that's ready to be pasted in.
For the purposes of this short guide, we're going to use Tynt as our target service to block. Remember, you can use this method to block anything. Simply apply the steps used here to put the kibosh on whatever other services or sites you choose.
If you're unfamiliar with Tynt, it basically appends an "attribution" link to any text copied off of a page that uses it. The usual user-response when this happens is an audible cursing of the site using it and a quick deletion of the added link.
While the site owners who use Tynt tend to claim they're doing it to ensure proper attribution, it's actually more about getting exposure and linkbacks. Anybody who's come across this annoyance can attest to the fact that it's not making anything proper or easy for the person doing the copying -- and contrary to the beliefs of the ultra-paranoid, a user shouldn't be branded a thief and plagiarist just for copying and pasting text.
Tynt works by using a JavaScript that's hosted on Tynt servers; it's called by code embedded in the page that's using it. The script itself is at tcr.tynt.com, so if your browser never connects to that server, the script won't load. What we're doing here is adding that hostname to a list of addresses on your computer that don't require DNS lookup. It's called your hosts file, and it's extremely useful, especially for little problems like this that crop up from time to time. Using this file, you can tell your computer that anytime it sees tcr.tynt.com, it should look straight to the IP that you give it (instead of using a DNS query). In this case, the IP address we're giving it is 0.0.0.0 -- which is a null address that will instantly fail to resolve.
Update:This post originally used 127.0.0.1 as the IP to point these services to, but as one of our commenters has pointed out, 0.0.0.0 is a slightly better option. You'll also find most pre-made lists of ad networks use 127.0.0.1 as well -- both addresses work fine, but 0.0.0.0 is preferable due to being null. Requests sent to 127.0.0.1 may be retried several times before failing. When a request is made to the null address, it fails immediately. Happy blocking!
(Thanks, Stinlen56.)
Already know all about adding entries to your hosts file?
Just add this line:
0.0.0.0 tcr.tynt.com
If you've never touched your hosts file before and need a little help, here's how to do it in Windows, Mac OS X, and Linux:
Windows:
Windows is a bit annoying when it comes to system files, so depending on which version of the OS you're using, it could be in a different place.
For XP:
1. Open "My Computer" and navigate to c:\windows\system32\drivers\etc\
2. Right-click on the file called "hosts" -- click Open
3. When prompted to choose an application to open the file, choose Notepad.
4. You should see one line at the bottom that reads 127.0.0.1 localhost
5. Add a line underneath it that reads 127.0.0.1 tcr.tynt.com then save the file.
When you're done, the bottom of your hosts file should look like this:
127.0.0.1 localhost
0.0.0.0 tcr.tynt.com
For XP Pro, you should be prompted for an admin password before editing the file. Otherwise, the process is the same as it is for XP Home. For NT/2000 systems, change c:\windows\ to c:\winnt\, and everything should fall into place accordingly.
For Windows 7 and Vista users, it's again in c:\windows\system32\drivers\etc\, but there's a slight twist to opening it. This time, you'll have to right-click on Notepad (it should be somewhere in your Start menu), and choose "Run as Administrator" from the resulting pop-up menu. That should open Notepad with elevated user-privileges, allowing you to edit system files. Now go to File and choose Open. Either navigate to the folder or simply enter c:\windows\system32\drivers\etc\hosts in the field available, and it should open the file for you to edit. Now, you just add the line and save the file!
Mac:
It's a sad fact that most Mac users don't even realize they're running a UNIX system. OS X keeps its hosts file in the same place as all other UNIX systems, as well as their Linux cousins; it's always /etc/hosts, and there are any number of ways to edit it.
For those of you who are savvy with the command line, just edit /etc/hosts with your text editor of choice as root (either using su or sudo). For the non-savvy out there, here's a quick breakdown using TextEdit:
1. Go to Applications, then open the Utilities folder.
2. Open Terminal
3. At the command prompt, type:
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts
4. Hit the Return key and enter your admin password when prompted.
Now TextEdit should open and display the contents of your hosts file 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
Note that it says "Do not change this entry" rather ominously; it's really telling you not to change the entries that are already there. Simply add another line to the file under those entries:
##
# 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
0.0.0.0 tcr.tynt.com
Save the file, quit TextEdit, and then quit Terminal. Et voila! You've just stopped Tynt from ever bothering you again on your Mac. That wasn't so scary now was it?
Linux:
Like I mentioned before, OS X and Linux distros have a lot in common, so you shouldn't have any trouble locating your hosts file if you're running a Linux box. However, since no two distros are alike, and that includes which text editors are present, it's a bit difficult to explain to new Linux users how to edit their hosts file without knowing what they've got to work with. Generally speaking, most Linux users are more tech-savvy than the average Joe, so I'm going to give you the benefit of the doubt and send you on your merry way with the hostname to add to the file.
add this to the bottom of your /etc/hosts file:
0.0.0.0 tcr.tynt.com
If you have trouble and don't know where to start, here's a quick step-by-step that uses the command line and Vi, an ancient text editor that's almost guaranteed to be on every Linux system in the known universe.
1. Open a terminal app, usually something like XTerm.
2. At the command prompt, enter sudo vi /etc/hosts
3. Enter your admin password when prompted.
The file will display for you. Now, using the arrow keys, move the cursor down to the very last line and over to the last character of the entry there. It will probably be hovering over the last letter of a word (probably "localhost"), and it won't move past the word. This is where you press the i key, which will toggle insert mode. Now, you should be able to move the cursor one more space to the right so that it's no longer over the last character of the word in that entry. Hit Enter to make a new line in the file.
Now, type (carefully) 0.0.0.0 tcr.tynt.com, and then hit Enter again to give it another new line underneath your new entry. Hit the Esc key to exit insert mode, and then hold the Shift key and type ZZ to save and exit Vi.
That's it!
Want to block even more annoyances? Check out MVPS.org's host file -- it's another fantastic list you can copy and paste into your your own hosts which includes hundreds of malicious and bothersome sites.














Comments
23
Subscribe to commentsStephen LangJun 17th 2010 9:38AM
Spybot Search & Destroy does this automatically:
http://fileforum.betanews.com/detail/Spybot-Search-Destroy/1043809773/1
jwgJun 17th 2010 9:46AM
You could also add them to your OpenDNS network settings.
stinlen56Jun 17th 2010 9:55AM
Instead of 127.0.0.1, I encourage you to use 0.0.0.0 to prevent any attempt at resolution. It's safer and faster.
Matthew RogersJun 17th 2010 12:05PM
You know I've actually heard that recently from someone else and I've just never tried it. I suppose going 0.0.0.0 is just like sending output to null.
stinlen56Jun 17th 2010 5:47PM
That is correct. While both will more than likely work just fine, even if you don't notice any difference, it makes more sense to resolve a blocked site to null than to localhost.
Matthew RogersJun 17th 2010 7:12PM
Went ahead and updated the post.
Jon NiolaJun 17th 2010 10:24AM
While a lot of that stuff is annoying, I really don't like people doing a blanket blocking of advertising. This is the very advertising that keeps the sites we go to free. This is the revenue that puts food on peoples' tables, creates jobs for web developers, artists, writers, IT folks, and funds R&D and innovation at hardware and software companies.
Do you think we would have great stuff like Google Voice, Google Maps, Facebook, Yahoo Sports etc etc if they were not bringing in revenue? Do you think Cisco would be making faster and better routers if companies like Microsoft and AOL etc were not spending millions on them?
Don't be freeloaders. Seriously. If something is doing harassing pop-ups or browser hijacks it is one thing but to blanket out every major advertising system on the web is a terrible idea.
Omar M.Jun 17th 2010 11:30AM
this is a tech site, i doubt that anyone here doesn't know what ads are, and i sure am ready to bet that no one who visits such sites has clicked an ad in a long time, what with adblock plus and all.. so if we're not clicking them, might as well hide them!
and don't worry, there are millions of regular web surfers who don't even know what ads are, and they are more than happy to click those ads to help google and its brothers. and to help you calm down!
seth4uJun 17th 2010 12:23PM
I don't see Google going bankrupt because I block their ads.
Ridley ScottJun 18th 2010 8:10PM
What a complete goober of a comment. Jesus, like we are not inundated with ads! Who (of those who've been surfing a while) is not totally annoyed with the pop-ups, etc. Forget about that feeding the kids crap too. Spoken like a marketing person. The internet can do without a thousand or so ads dweeb.
Robert MarcusJun 23rd 2010 4:40PM
I work in advertising and I WHOLEHEARTEDLY disagree with you on this point. The advertising world makes VERY little profit off of internet. Frankly, if more sites would offer tiered subscriber service (similar to Pandora) then they could fill the shortfall in revenue. It's predominantly the industries that have big bloated budgets that require huge ad revenues. If we have to do more with less, then they should too. These ads are OUT OF CONTROL. You can't even go to the bathroom without staring at one.
Furthermore, the ads are more and more frequently shifting to direct product placement in shows and movies. They're going back to what worked before.
Lastly, banner ads and other online advertisement have a very miniscule interaction rate. Somewhere between 1-2% for banners, and 4-12% for interstitials (those ones that come inbetween shows and inbetween pages). This means that only 1-2% are clicking and from there you have an even smaller rate of people buying into what they click on.
Don't believe the hype they are selling you. Advertisers are just middlemen making money off of the consumers and the clients both.
DonJun 28th 2010 1:41AM
I could care less about your arguments. I hate advertising. It sucks. And Adblock Plus takes care of it handily.
johndandison.comJun 17th 2010 12:51PM
Other options for the less-experienced linux users - use something like gedit if you're used to the graphical interface. gedit is good for gnome-desktops (like the default in ubuntu), or kedit.
sudo gedit /etc/hosts
johndandison.comJun 17th 2010 12:52PM
Or kate for kubuntu\kde-based desktops...not kedit.
NnyanJun 17th 2010 1:39PM
So should we use the block list from mvps.org or pgl.yoyo.org?
Matthew RogersJun 17th 2010 7:08PM
They're both great lists!
st3adyJun 18th 2010 1:51PM
will this work for blocking those annoying livejasmin.com popups? i have adblock plus, but they still come through! arrghh
LoveJun 18th 2010 3:59PM
You sound like COINTELPRO.
Do you think we would have great stuff like Google Voice, Google Maps, Facebook, Yahoo Sports
NONE of those are great things. Especially Google and Facebook! You do know they sell your info to the CIA, NSA, and FBI, right?
powerhouselb2Jun 24th 2010 11:29AM
Block the annoying video ads on youtube that play just before the video of choice. Nice.
powerhouselb2Jun 24th 2010 1:32PM
oops. i was wrong. it didn't block the youtube advertisements that play before selected videos.