Boring Video ADS on Youtube seem to download content from the domain 2mdn.net, precisely from the url http://s0.2mdn.net/instream/flash/v3/adsapi_3.swf .
A very simple procedure to avoid Video Ads is to modify the (famous) HOSTS file letting your operating system to resolve the domain 2mdn.net with ip 127.0.0.1 (your own system) actually blocking downloads of pages, code and videos from the ads system. I prefer this procedure than many others you can find on internet because it’s not necessary to install anything on you computer.
How to do it (I assume you have a Windows machine, if not, find the HOSTS file on your system):
- Start Menu -> Accessories -> right click on “Command prompt” -> click on “Run as administrator“. A black window will open. If you have a Windows XP pc, simply open a commad prompt window;
- cut and paste in the command window this string “notepad c:\Windows\System32\drivers\etc\hosts” (then press “enter” key);
- notepad will open, then put those lines at the end of file
127.0.0.1 s0.2mdn.net
127.0.0.1 s1.2mdn.net
127.0.0.1 googleads.g.doubleclick.net(without quotes) You should see something like the picture;
- close notepad saving the file;
- in the command window run this command ipconfig /flushdns (“enter“!) to flush DNS cache of your PC;
- close the command window.
Try to navigate Youtube, now you shouldn’t see any Video ADS before your preferred videos.
NOTE: Thank you to Lorenz for troubleshooting and comments.


hey man didn’t worked for me, cause when i have added the strings in the hosts file it doesn’t make me save it cos he want to save it as a hosts.txt file. if i try to save as the hosts file it doesn’t allow me to do it…. i’m almost sure i followed every step correctly.. but the way i’m the computer admin i’m in italy but i have windows 7 home premium 32 bit in english
Dear Joney,
the only reason for wich you are not able to save host file is that you did not launch notepad “as administrator”.
See this link http://helpdeskgeek.com/windows-7/windows-7-hosts-file/.
I hope you’ll solve. Feel free to contact me again if not.
Enjoy!
Ah ho notato ora che sei italiano
Si avevi ragione stranamente anche se ho aperto il command prompt con diritti di amministratore il notepad non aveva gli stessi diritti, alla fine ce l’ho fatta anche se ho dovuto fermare la protezione dell’antivirus perchè bloccava l’accesso al file hosts..
Un grazie enorme Lollo!
Di nulla!

Ti ciedo solo una cortesia, se ritieni utilie il mio post, condividilo sui social!
Buon divertimento!!!!
I worked!!!! Thank you soo much, I really applaud you intelligence, once again thanks!
It worked!!!! Thank you soo much, I really applaud your intelligence, once again thanks!
typo….
to your intellgigence………………………………………
intelligence
Thank you!
Please, share this post!
grazie!
You‘re welcome!
You are awesome! The solution does exactly what you describe and what I need. And it doesnt require any suspecious 3rd party program (I love transparent solutions).
Thanks again!
I’m glad I could help you!

Share this post if you liked!
Thanks! …and enjoy music!
it sort of works for me, videos with ads now hang loading and don’t start playing unless I fast forward a second or two. I was wondering if you might have an updated solution to combat this. I enjoyed the initial suggestion and learning further how this stuff works so thanks! Best! Mike
Mmm! Strange!…
For me it’s the same but after some seconds videos begin.
First of all, empty the browser cache then try and wait and let me know if the video starts and after how many seconds (more or less, of course… ).
Thank you!
SUL8R
Cheers!
actually I noticed after posting that if I waited about 10 seconds it then plays, so this revision is better, yet not ideal. Was wondering if there might be some way to take this further and place a file on local host that mimics a very short ad to eliminate the delay. That may be too complicated, I don’t know, but I’m very interested to hear what the experts have to say, suggest and teach about this. Thanks! Mikey il Pelicano
Dear MikeD, sorry for the late reply.
Yes, you are right, it’s necessary to wait 10 seconds (more or less) before a video plays but I think this is “by design” for the Youtube’s flash application that plays videos.
I tried to modify my hosts file to point the records in the post to my own webserver to have a “404 file not found” reply, but, also in this case, the time to wait is always 10 seconds. So, in the end, I think that it’s not a problem of timeout (like in the case hosts file point to your machine where, usually, there isn’t a listening webserver) because also when you simulate a 404 error the matter is the same.
That means that, sincerely, at the moment, I don’t know how to solve this little issue.
Anyway, personally I prefer to wait for some seconds of silence than for a commercial! (paraphrasing the proverb, “Speech is silver, silence is golden and commercials are sh!t !!!“).
Cheers!
it doesn’t work on windows7 x64, in command prompt “ipconfig\flushdns” is not a supported command
Dear Bosman, IPCONFING is a standard Windows OS command but you have to type “ipconfig /flushdns” and not “ipconfig\flushdns”. At least, you have to open a DOS Windows doing a right-click and then “Open as Administrator”. But don’t mind, if you reboot your pc you’ll take the same result of the “ipconfig /flushdns” command.
Enjoy Youtube-with-no-video-ads!
it works. thanks for patience…
I’m glad I could help you!
If you liked it, share this post on your social networks!
Thank you!
Cheers!
I dont see any instructions for MAC users.
See the link to Wikipedia suggested in the post ( http://en.wikipedia.org/wiki/Hosts_%28file%29 ) and locate the section “Apple Macintosh“, there is the file system location of the hosts file for a MAC.
Edit the hosts file, and put there the three records suggested in the post (127.0.0.1 …).
Sincerly, I do not know how to exactly edit the hosts file on a MAC, I’m a windows user, but I think it could be similar to a linux system. This link may help you : http://www.webhostinghub.com/support/domain-names/dns-nameserver-changes/change-hosts-file-on-a-mac .
Let me know!
Cheers!
awesome bro it worked for me in india..
Great! Publicize the news in India making some trackbacks to my page!
Thank you! And have good videos-without-ads!
I think Youtube has made some changes. I am still getting ads.
I think that’s because you are in another country/continent, I think there are different servers based on your location, in Italy hosts indicated seem to work well.
I’ll try to see what servers are used in India using TOR network or a proxy there.
Bye!
Hi,
for me in Italia it didn’t work. But could be that i haven’t been able to do it.
I followed your instructions as:
-i cut and pasted “c:\Windows\System32\drivers\etc\hosts” in the command window of the Accessories, then i clicked “enter” key but it come out that the command is not recognised as an internal or an external command. It didn’t work.
So, how i can do?
Thank you!
Of course Karma, you have forgotten to place “notepad” before “c:\Windows\System32\drivers\etc\hosts”.
The command is “notepad”!
Let me know if you resolve.
Cheers!
It seems that yoyu have to put one more record to block video ads in HTTPS:
127.0.0.1 googleads.g.doubleclick.net
Try with this video https://www.youtube.com/watch?v=9bZkp7q19f0 with and without the new record suggested.
IMPORTANT: flush your DNS cache (ipconfig /flushdns) and empty your browser cache every time you try.
Bye!
Fantasticooo!