Everyone loves Spotify and sometimes during development, but are tired of its ads that keep coming between songs. Here is a way to block ads through your host file be it Windows or Mac.
# — Spotify Ad Block 127.0.0.1 media-match.com 127.0.0.1 adclick.g.doublecklick.net 127.0.0.1 googleads.g.doubleclick.net 127.0.0.1 http://www.googleadservices.com 127.0.0.1 pagead2.googlesyndication.com 127.0.0.1 desktop.spotify.com 127.0.0.1 pubads.g.doubleclick.net 127.0.0.1 audio2.spotify.com 127.0.0.1 crashdump.spotify.com 127.0.0.1 adeventtracker.spotify.com 127.0.0.1 log.spotify.com 127.0.0.1 analytics.spotify.com 127.0.0.1 ads-fa.spotify.com 127.0.0.1 audio-ec.spotify.com 127.0.0.1 heads-ec.spotify.com 127.0.0.1 prod.spotify.map.fastlylb.net 127.0.0.1 sto3.spotify.com 127.0.0.1 spclient.wg.spotify.com 127.0.0.1 upgrade.spotify.com # — Spotify Ads Block End
Add the above contents in your host file.
C:\Windows\System32\drivers\etc . Open the hosts' file as administrator and add the above contents to it. (You could open notepad/Sublime/Atom as administrator and browse to open the hosts' file.)
Note: Incase the newly added mappings are not working try restarting Windows to take effect
To find the hosts file, open Finder and, in Finder's menu bar, select Go > Go to Folder. In the box, type the following location and press Return.
To open it, simply double-click and it will display the file's contents in TextEdit (or the text editor of your choice). Add the host content in it and save.
In most cases, the new mapping should work immediately, but if you're not seeing the correct behavior, you may need to flush your DNS cache. For OS X Lion and OS X Mountain Lion, open Terminal and use the following command. Note that you’ll need to enter your admin password to execute it:
sudo killall -HUP mDNSResponder
For OS X Mavericks +, use this command instead:
dscacheutil -flushcache; sudo killall -HUP mDNSResponder
You could also launch Terminal, type the following command, and press Return. As with all sudo commands, you'll need to also enter your admin password to execute it:
sudo nano /private/etc/hosts
When you're done making changes, press Control-X to exit the editor, Y to save, and Return to overwrite the existing hosts' file. As mentioned earlier, make sure to flush your DNS cache if you notice that your new mappings aren’t working properly.
Do let me know if it works or needs any change in the host file contents in the comment section below.
Write. Share what you know/ how to fix/break/fix things :)
I love the Web. ❤️❤️❤️
As software gets more and more integrated into our lives, the industrialization of its crafting process becomes inevitable. But the over-generalization of software engineering can be crushing the creative side of programming.