Blog

DNS Ad-Blocking with Adguard

Posted November 6, 2017. Updated August 24, 2018.

Update - Adguard and other network tools are facing arbitrary sanctions by Apple, despite not violating App Store guidelines. Read Adguard’s post for more information, and consider leaving Apple feedback to encourage a reversal of judgement.

I started off using Adguard’s free DNS to block ads on my phone. It’s awesome, because it rejects tracking and advertising in most applications, not just your web browser. To set it up, you’ll need to edit your Wifi’s DNS field for every single network you use: home, work, school, etc. There’s a regular server, or one for “family protection” that blocks porn and tries to enforce safe-search settings. Just copy and paste whichever one you want; two servers are provided for reliability, and the longer addresses are for IPv6.

    Default
  • 176.103.130.130
  • 176.103.130.131
  • 2a00:5a60::ad1:0ff
  • 2a00:5a60::ad2:0ff
    No Porn
  • 176.103.130.132
  • 176.103.130.134
  • 2a00:5a60::bad1:0ff
  • 2a00:5a60::bad2:0ff

Snapchat downloads ads from snap-ads.snapchat.com, but they use app.snapchat.com for messaging. Since they're different, Adguard's DNS refuses to download ads, but you still get snaps. Some apps will send everything through one domain, so the only way to block ads is by blocking everything, which doesn’t work. The YouTube app sends everything together, so you have no choice, unless you use a web browser and modify the page.

Unfortunately, you can’t edit your cellular data DNS without using a custom VPN on your iPhone. I see this as room for Apple to step up and increase user-privacy, but at least you can take control with Adguard until Apple covers the gaps. And having to edit every wifi network is a little obnoxious, so for me, it was worth purchasing Adguard Pro for iOS. Esecially since I'm more concerned about using my mobile data, being able to control the network connections is very important. If you have an Android, you’ll have to pay more for Adguard, but you can also apply for a free license. There are many firewall apps, such as NoRoot Firewall, but you can find something for free and get different blacklists.

DNS filtering also shows what companies are doing to violate your privacy or consume your bandwidth. Requests for external fonts, Google Analytics, or app-troubleshooting services can be blocked, making your phone more private, save battery, and run faster.

As you use different apps or monitor your connections, you'll see new stuff and maybe need to modify things depending on what you want. Adguard has documentation for syntax, which was very helpful in learning to modify YouTube's mobile website. I can now listen to music with my screen off, which I've described in this post.

After using my phone for a bit, I would go through and identify unnecessary or unwanted requests, gradually fine-tuning everything and trying to have the bare minimum amount of connections. Now websites are much faster and apps use less data, so I'm very happy.

Here are links to my blacklist and my whitelist, so you can copy/paste what you want. It's also annotated below, because using the list without understanding it will cause your apps to break unexpectedly. I've taken an extreme approach and deliberatley made things break, because I don't have time for bad websites that are obnoxious to fix. Once your custom blacklist is good enough, you can switch to a different DNS provider, like 1.1.1.1 or use your network's default server.

Blacklist.txt

Breaking
  • *.cloudflare.*
  • *.googlesyndication.com
  • static1.squarespace.com
  • static2.squarespace.com
Redirectors & Link Tracking
  • bit.ly
  • t.co
  • goo.gl
  • l.instagram.com
  • l.facebook.com
General App Trackers
  • *.appboy.com
  • *.appsflyer.com
  • *.comscoreresearch.com
  • *.crashlytics.com
  • *.localytics.com
  • *.bugsnag.com
  • *.cardlytics.com
  • *.flurry.com
  • analytics.query.yahoo.com
  • analytics.twitter.com
  • *.mobileapptracking.com
  • *.list-manage.cofm
Facebook
  • *.facebook.*
  • *.fb.com
  • video.fsjc1-3.fna.fbcdn.net
  • scontent.fsjc1-3.fna.fbcdn.net
  • external.fsjc1-3.fna.fbcdn.net
  • fbcdn.net
  • fbsbx.com
Snapchat
  • *.bitmoji.com
  • *.shazam.com
  • app-analytics.snapchat.com
  • *.snapads.com
  • usc.adserver.snapads.com
  • mvm.snapchat.com
  • snap.licdn.com
Spotify
  • heads-ak.spotify.com.edgesuite.net
  • video-fa.cdn.spotify.com
Instagram
  • graph.instagram.com
Apple iOS
    • Maps
    • *.yelpcdn.com
    • System
    • www.apple.com
    • www.icloud.com
    • *.smoot.apple.com
    • apple.com
    • apple.comscoreresearch.com
    • api.weather.com
    • App Store
    • *.mzstatic.com
    • mt-ingestion-service-mr22.itunes-apple.com.akadns.net
Fonts
  • *.myfonts.net
  • *.fontawesome.com
  • fonts.*
  • typeface.nytimes.com
  • use.typekit.net
Google (web and app)
  • *.doubleclick.net
  • www.google.com
  • www.googleadservices.com
  • www.googletagmanager.com
  • www.googletagservices.com
  • *.google-analytics.com
  • id.google.com
  • iid.googleapis.com
  • storage.googleapis.com
  • suggestqueries.google.com
  • adservice.google.com
  • safebrowsing.googleapis.com
  • clients1.google.com
  • cloudconfig.googleapis.com
  • cse.google.com
  • csi.gstatic.com
  • datamixer-pa.googleapis.com
  • device-provisioning.googleapis.com
  • forcesafesearch.google.com
  • feelinsonice-mvm.l.google.com
  • feelinsonice.l.google.com
  • growth-pa.googleapis.com
  • imasdk.googleapis.com
  • maps.googleapis.com
  • pagead2.googlesyndication.com
YouTube
  • *.ytimg.com
  • youtubei.googleapis.com
Yahoo & Tumblr
  • *.yahoo.com
  • cookiex.ngd.yahoo.com
  • m.yap.yahoo.com
  • policies.yahoo.com
  • s.gycs.b.yahoodns.net
  • safely.yahoo.com
Geolocation
  • geo.query.yahoo.com
  • geo.yahoo.com
  • geoip.fing.io
  • geoip.ubuntu.com
  • geo.*
  • geoip.*
Social
  • pinterest.*
  • *.sharethis.com
  • *.disquscdn.com
  • *.linkedin.com
  • *.addtoany.com
  • *.gravatar.com
  • *.grvcdn.com
  • *.tumblr.com
  • *.twitter.com
  • v.pinimg.com
Finance
  • api-m.paypal.com
  • b.stats.paypal.com
  • www.paypalobjects.com
  • *.stripe.*
  • usbank.demdex.net
  • smetrics.usbank.com
Generalized Rules
  • pixel.*
  • geo.*
  • geoip.*
  • tag.*
  • tags.*
  • beacon.*
  • track.*
  • tracker.*
  • events.*
  • event.*
Miscellaneous
  • *.aol.com
  • *.aolcdn.com
  • certificates.godaddy.com
  • *.godaddy.com
  • www.tripadvisor.com
  • x.email.sacbee.com
  • *.2mdn.net
  • *.aliyuncs.com
  • syndication.twitter.com
  • sstats.arstechnica.com
  • *.affirm.com
  • *.bid
  • *.branch.io
  • *.braze.com
  • *.cedexis.com
  • *.co.uk
  • *.demdex.net
  • *.doubleverify.com
  • *.ensighten.com
  • *.eum-appdynamics.com
  • *.flipboard.com
  • *.foresee.com
  • *.foreseeresults.com
  • *.forter.com
  • *.fwmrm.net
  • *.gigya.com
  • *.hulu.com
  • *.imrworldwide.com
  • *.issuu.com
  • *.isu.pub
  • *.publicityclerks.com
  • *.printfriendly.com
  • *.leanplum.com
  • *.litix.io
  • *.livefyre.com
  • *.liveperson.net
  • *.mapbox.com
  • *.measuread.com
  • *.moatads.com
  • *.mopub.com
  • *.npttech.com
  • *.nr-data.net
  • *.omtrdc.net
  • *.online-metrix.net
  • *.ooyala.com
  • *.outbrain.com
  • *.payfone.com
  • *.quantserve.com
  • *.scorecardresearch.com
  • *.swiftypecdn.com
  • *.tinypass.com
  • *.trackjs.com
  • *.trafficjunky.net
  • *.uservoice.com
  • *.vidible.tv
  • *.voicefive.com
  • 4d.condenastdigital.com
  • accdn.lpsnmedia.net
  • acdn.adnxs.com
  • api.amplitude.com
  • api.essenzasoftware.com
  • api.mixpanel.com
  • api.parsely.com
  • api.weibo.com
  • api.yelp.com
  • app-measurement.com
  • app.link
  • appboy-images.com
  • appserver.dynamicappdesign.com
  • assets.adobedtm.com
  • autosug.ebay.com
  • az610484.vo.msecnd.net
  • bat.bing.com
  • bs.serving-sys.com
  • capture.condenastdigital.com
  • cdn.appdynamics.com
  • cdn.cookielaw.org
  • cdn.doublepimpssl.com
  • cdn.jsdelivr.net
  • cdn.mediavoice.com
  • cdn.printfriendly.com
  • cdn.quantummetric.com
  • cf-preview-media.sndcdn.com
  • click.e.kickstarter.com
  • cnc.addlive.io
  • cognito-identity.us-east-1.amazonaws.com
  • collector-pxel3l4xih.perimeterx.net
  • conf-trusted.lyr8.net
  • control.d-imaging.sony.co.jp
  • crazycode.oss-cn-hongkong.aliyuncs.com
  • d3rt1990lpmkn.cloudfront.net
  • dc.applicationinsights.microsoft.com
  • dev.appboy.com
  • dfn-tgt-us.wixprod.net
  • disqus.com
  • e11484.e12.akamaiedge.net
  • e12.whatsapp.net
  • e4478.a.akamaiedge.net
  • ebay.com.*
  • *.ebay.*
  • ece-logger.nandomedia.com
  • encrypted-tbn1.gstatic.com
  • etahub.com
  • events.redditmedia.com
  • events.rounds.video
  • ffp4g1ylyit3jdyti1hqcvtb-wpengine.netdna-ssl.com
  • gate.hockeyapp.net
  • getpocket.cdn.mozilla.net
  • guzzoni.apple.com
  • hexagon-analytics.com
  • higheurest.com
  • home.redframe.com
  • i.guim.co.uk
  • i.scdn.co
  • iconosquare.com
  • infinityid.condenastdigital.com
  • init.itunes.apple.com
  • instalog-prod.sc-prod.net
  • iphonesubmissions.apple.com.akadns.net
  • iris.mdlabs.se
  • jetpack.wordpress.com
  • js.appboycdn.com
  • lb._dns-sd._udp.0.32.11.10.in-addr.arpa
  • lumulabs.zendesk.com
  • m.ilritj92ic.com
  • m.me
  • m1.nsimg.net
  • m2.nsimg.net
  • maxcdn.bootstrapcdn.com
  • mcclatchy.dynatracesaas.com
  • mdlabsnews.appspot.com
  • media.trafficjunky.net
  • mes5apps.com
  • mixpanel.com
  • mobile.eum-appdynamics.com
  • mobilenotification.com-com.pro
  • mpsnare.iesnare.com
  • museworks.zendesk.com
  • mwparse.museworks.co
  • nytimes.map.fastly.net
  • ocsp.comodoca.com
  • ocsp.entrust.net
  • offerup-rest.ably.io
  • onesignal.com
  • optanon.blob.core.windows.net
  • oup.silverchair-cdn.com
  • p.travelsmarter.net
  • p21-bookmarks.fe.apple-dns.net
  • p21-bookmarks.icloud.com
  • p21-quota.icloud.com
  • pancake.g.aaplimg.com
  • pbs.twimg.com
  • pinterest.*
  • pixel.redditmedia.com
  • pixel.quantserve.com
  • pixiedust.buzzfeed.com
  • platform.twitter.com
  • play.googleapis.com
  • player.cnevids.com
  • presence.glance.net
  • public-api.wordpress.com
  • push.apple.com
  • px.gfycat.com
  • r-login.wordpress.com
  • raspiadkwcecz.com
  • recommend.troncdata.com
  • s.adroll.com
  • s.amazon-adsystem.com
  • samizdat-graphql-v1-prd-i-113036-2119479663.us-east-1.elb.amazonaws.com
  • sc-connect.squareup.com
  • securely.link
  • segment-data.zqtk.net
  • serve.popads.net
  • server.firech.at
  • siteintercept.qualtrics.com
  • sr.symcd.com
  • ssl.cdn.turner.com
  • ssor.tribdss.com
  • static.criteo.net
  • syndication.exoclick.com
  • tag.bounceexchange.com
  • tag.researchnow.com
  • tags.crwdcntrl.net
  • tororango.com
  • track.interquest.com
  • traefik-p-elasticl-9nxpkwjfwnzb-2044881035.us-east-1.elb.amazonaws.com
  • trk10.com
  • twemoji.maxcdn.com
  • viewcount-1964976613.us-east-1.elb.amazonaws.com
  • vip-lb.wordpress.com
  • w.usabilla.com
  • *.jamclicks.com
  • ws.pusherapp.com
  • www.jscache.com
  • www.trbas.com
  • www.trbimg.com
  • www.tribdss.com
  • *.uservoice.com
  • ig.me
  • *.adj.st
  • *.rlcdn.com
  • *.adsrvr.org
  • *.brightcove.com
  • *.outbound.io
  • biz.yelp.*
  • *.addthis.com
  • www.fluxtrkr.com
  • *.download
  • yllanorin.com

Whitelist.txt

Snapchat
  • auth.snapchat.com
  • app.snapchat.com
  • chat-gateway-prod.chat.snapchat.com
  • mvm.snapchat.com
  • snap.api.mapbox.com
Un-breaking
  • static1.squarespace.com
  • static2.squarespace.com
  • stun1.l.google.com
  • cdnjs.cloudflare.com
  • format.com.cdn.cloudflare.net
  • cdn.branch.io
  • auto-api.yelp.com
  • cdn01.boxcdn.net
  • queuer-prod-elb.53.localytics.com
Facebook and Instagram
  • instagram.fsjc1-3.fna.fbcdn.net
  • instagram.fsnc1-1.fna.fbcdn.net
  • mqtt.c10r.facebook.com
  • i.instagram.com
  • scontent-sea1-1.cdninstagram.com
  • www.instagram.com
  • instagram.fsea1-1.fna.fbcdn.net
  • star.c10r.facebook.com
  • edge-mqtt.facebook.com
  • graph.accountkit.com
  • instagram.c10r.facebook.com
  • z-p15-instagram.c10r.facebook.com
Apple
  • xp.apple.com
  • xp.itunes-apple.com.akadns.net
  • origin.guzzoni-apple.com.akadns.net
  • ussea-edge-012.icloud-content.com
  • 10-courier.push.apple.com
  • init-p01st.push.apple.com
  • s.mzstatic.com
  • is3-ssl.mzstatic.com
  • *.icloud-content.com
  • apps.mzstatic.com
  • gs-loc.apple.com
  • mesu.apple.com
  • cdn.apple-mapkit.com
  • ussea-edge-016.icloud-content.com
  • is2-ssl.mzstatic.com
Reddit and Gfycat
  • www.reddit.com
  • oauth.reddit.com
  • out.reddit.com
  • i.reddit.com
  • gfycat.com
  • thumbs.gfycat.com
YouTube
  • www.youtube.com
  • *.googleusercontent.com
  • i.ytimg.com
  • i9.ytimg.com
  • s.ytimg.com
  • yt3.ggpht.com
Tumblr
  • www.tumblr.com
  • assets.tumblr.com
  • mx.tumblr.com
  • static.tumblr.com
  • *.media.tumblr.com
  • vtt.tumblr.com
  • ls.srvcs.tumblr.com
  • api-http2.tumblr.com
eBay
  • svcs.ebay.com
  • api.ebay.com
  • api.g.ebay.com
  • svcs.g.ebay.com
  • www.ebay.com
  • m.ebay.com
  • apisd.ebay.com
  • mobiselling.ebay.com
  • mobidcs.ebay.com
  • mobiselling.g.ebay.com
  • signin.ebay.com
Miscellaneous
  • ocsp.digicert.com
  • attdashboard.wireless.att.com
  • isrg.trustid.ocsp.identrust.com
  • www.bonappetit.com
  • raw.githubusercontent.com