Skip to content
Blog Remove ads injected by ISPs (Asianet in my case)

Remove ads injected by ISPs (Asianet in my case)

Read it full here : Asianet(ISP) injecting javascript code(ads) in every webpage requested by the customer

Here asianet(ISP) is injecting a javascript code into a website without the permission of the website owner and that’s against law.

This is the piece of code they are inserting


I have informed the authorities about this, i don’t know whether they will take take any action against it or not.

Anyway here’s a small tip on how to prevent the ad from appearing on the webpages.

In windows:
Edit the file "C:\windows\system32\drivers\etc\hosts"
and add the following line at the bottom of the file –

In Linux:
Edit the file "/etc/hosts/"
and add the same line to bottom of the file.

Now clear your browser cache or just shift+refresh a page.

22 thoughts on “Remove ads injected by ISPs (Asianet in my case)”

  1. Dear Dipin,
    The annoying redirect link was successfully bypassed with the help of troubleshooting steps and code induction suggested by you.

    Sincere thanks and regards,

  2. I just get out this headache. I am actually a webdeveloper and most of the time I need to refresh my page and ads are killing me. Your simple code help me thank you.


  3. Thanks for the tip. I’m in Kolkata. My ISP is a cable operator Tirupathi Internet that gets bandwidth from a local bandwidth wholesaler.

  4. Thanks. Your method worked out great. and as for the people who can’t get this method to work, please follow what it says. CLEAR THE CACHE AFTER YOU PASTE THE LINE at the end of the file. And yes, just to be sure, i cleared the cookies as well.
    Thanks again.

  5. This is a serious issue and we should not let them on with that. The hostfile trick will work, but it is not a solution. It is a question of customer right.

    We need to let them know our protest and if nothing works, we need to find a better ISP. There are lot of ISPs around and let them teach a lesson. People, don’t just get satisfied with the hostfile trick, express your protest and whoever have access to a better ISP, please start cancelling your accounts.

    Please be aware that we are paying customers and they have no rights to push the ads on someone else’s content. You know how Google is not putting ads on news / image results. Asianet can’t put ads on someone elses site, especially when we are paying for the ISP service. This is against all applicable laws and they need to taught a lesson.

    People, call up the corporate office, your local asianet office, send compaints via email and protest in every way possible.

  6. Hi,
    I pasted the line in hosts, but still the ad is coming. I am using chrome.

    it already had a line at its end called localhost.

    Please help me regarding this.

  7. Thanks for this post. I was facing the same problem. My ISP is Connect(Panchkula). Thinking this as a virus or adware I was trying all kinds of security software but obviously they did not help 🙂

  8. ..and also because Asianet itself, when accused (by me):

    1) denied;
    2) admitted but said it was perfectly legal;
    3) faced with a possible class action in front of a Court, said they needed to talk with their lawyers to analyze possible legal issues (“we’ll let you know).

  9. Thanks for the post. I was not able to access the pages of an online course and was baffled. Your post helped me to zero in on the problem. The script inserted by Asianet is causing the problem. Have mailed to them.

  10. Hi Dipin,

    thanks for sharing this.
    Just one question: how do you know it’s the provider the culprit?
    And, in this case, asianet?
    I am asking because this problem is spreading around the world, there have been many cases in Europe and, yes, they were injected by the local providers.

  11. Akhilesh B Chandran

    I was also facing the same problem !
    I never thought that it would be the ISP doing this injection !!!

    I’ve mailed them yesterday, asking about this and till now they haven’t replied to my mail !

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.