Hosts File: What it is and how to use it.

Hosts File: What it is and how to use it.

Overview

Ah, the humble Hosts file, a cornerstone of internet navigation and a geek's best friend for custom domain mapping and ad blocking. Today, we embark on a nostalgic journey through the digital nooks and crannies of operating systems, exploring where this plain text powerhouse resides across a spectrum of platforms. From Windows to iOS, and Unix to Android, if you've ever wondered how to bend the internet to your will (or at least, make it a bit more bearable), you've come to the right place.

According to Wikipedia, the computer file hosts is an operating system file that maps hostnames to IP addresses. It is a plain text file. Originally a file named HOSTS.TXT was manually maintained and made available via file sharing by Stanford Research Institute.

Basically, the Hosts serve to redirect local domains and block access to resources on the internet.

Locais

Operating SystemVersionsLocation
Unix, Unix-like, POSIX/etc/hosts
Microsoft Windows3.1%WinDir%\HOSTS
Microsoft Windows95, 98, ME%WinDir%\hosts
Microsoft WindowsNT, 2000, XP, 2003, Vista, 2008, 7, 2012, 8, 10%SystemRoot%\System32\drivers\etc\hosts
Windows Mobile, Windows PhoneRegistry: HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts
Apple Macintosh9 and earlierPreferences or System folder
Apple MacintoshMac OS X 10.0–10.1.5(Added through NetInfo or niload)
Apple MacintoshMac OS X 10.2 and newer/etc/hosts (a symbolic link to /private/etc/hosts)
Novell NetWareSYS:etc\hosts
OS/2 & eComStation"bootdrive":\mptn\etc\
SymbianSymbian OS 6.1–9.0C:\system\data\hosts
SymbianSymbian OS 9.1+C:\private\10000882\hosts
MorphOSNetStackENVARC:sys/net/hosts
AmigaOS4DEVS:Internet/hosts
AROSENVARC:AROSTCP/db/hosts
Android/etc/hosts (a symbolic link to /system/etc/hosts)
iOSiOS 2.0 and newer/etc/hosts (a symbolic link to /private/etc/hosts)
TOPS-20HOSTS.TXT
Plan 9/lib/ndb/hosts
BeOS/boot/beos/etc/hosts
Haiku/boot/common/settings/network/hosts
OpenVMSUCXUCX$HOST
OpenVMSTCPwareTCPIP$HOST
3.7, 5!Boot.Resources.!Internet.files.Hosts
RISC OSlater boot sequence!Boot.Choices.Hardware.Disabled.Internet.Files.Hosts

Examples

  • Original Windows Hosts
 1# Copyright (c) 1993-2006 Microsoft Corp.
 2#
 3# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
 4#
 5# This file contains the mappings of IP addresses to host names. Each
 6# entry should be kept on an individual line. The IP address should
 7# be placed in the first column followed by the corresponding host name.
 8# The IP address and the host name should be separated by at least one
 9# space.
10#
11# Additionally, comments (such as these) may be inserted on individual
12# lines or following the machine name denoted by a '#' symbol.
13#
14# For example:
15#
16#      102.54.94.97     rhino.acme.com          # source server
17#       38.25.63.10     x.acme.com              # x client host
18
19# localhost name resolution is handle within DNS itself.
20#       127.0.0.1       localhost
21#       ::1             localhost
  • Hosts file blocking Adobe and Techsmish (Warning: if you use this file, some softwares may not work properly afterwards).
 1# Copyright (c) 1993-2009 Microsoft Corp.
 2#
 3# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
 4#
 5# This file contains the mappings of IP addresses to host names. Each
 6# entry should be kept on an individual line. The IP address should
 7# be placed in the first column followed by the corresponding host name.
 8# The IP address and the host name should be separated by at least one
 9# space.
10#
11# Additionally, comments (such as these) may be inserted on individual
12# lines or following the machine name denoted by a '#' symbol.
13#
14# For example:
15#
16#      102.54.94.97     rhino.acme.com          # source server
17#       38.25.63.10     x.acme.com              # x client host
18
19# localhost name resolution is handled within DNS itself.
20#	127.0.0.1       localhost
21#	::1             localhost
22
23#Adobe Blocker
24127.0.0.1 na1r.services.adobe.com 
25127.0.0.1 hlrcv.stage.adobe.com 
26127.0.0.1 lmlicenses.wip4.adobe.com 
27127.0.0.1 lm.licenses.adobe.com 
28127.0.0.1 activate.adobe.com 
29127.0.0.1 practivate.adobe.com 
30
31#Techsmith blocker
32127.0.0.1 activation.cloud.techsmith.com
33127.0.0.1 oscount.techsmith.com
34127.0.0.1 updater.techsmith.com
35127.0.0.1 camtasiatudi.techsmith.com
36127.0.0.1 tsccloud.cloudapp.net
37127.0.0.1 assets.cloud.techsmith.com
  • Unnecessarily large Hosts File blocking Ad serving sites.
  1# Copyright (c) 1993-2009 Microsoft Corp.
  2#
  3# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
  4#
  5# This file contains the mappings of IP addresses to host names. Each
  6# entry should be kept on an individual line. The IP address should
  7# be placed in the first column followed by the corresponding host name.
  8# The IP address and the host name should be separated by at least one
  9# space.
 10#
 11# Additionally, comments (such as these) may be inserted on individual
 12# lines or following the machine name denoted by a '#' symbol.
 13#
 14# For example:
 15#
 16#      102.54.94.97     rhino.acme.com          # source server
 17#       38.25.63.10     x.acme.com              # x client host
 18
 19# localhost name resolution is handled within DNS itself.
 20#	127.0.0.1       localhost
 21#	::1             localhost
 22
 23#Adobe Blocker
 24127.0.0.1 na1r.services.adobe.com 
 25127.0.0.1 hlrcv.stage.adobe.com 
 26127.0.0.1 lmlicenses.wip4.adobe.com 
 27127.0.0.1 lm.licenses.adobe.com 
 28127.0.0.1 activate.adobe.com 
 29127.0.0.1 practivate.adobe.com 
 30
 31#Techsmith blocker
 32127.0.0.1 activation.cloud.techsmith.com
 33127.0.0.1 oscount.techsmith.com
 34127.0.0.1 updater.techsmith.com
 35127.0.0.1 camtasiatudi.techsmith.com
 36127.0.0.1 tsccloud.cloudapp.net
 37127.0.0.1 assets.cloud.techsmith.com
 38
 39# [Start of entries generated by MVPS HOSTS]
 40#
 41# [Misc A - Z]
 420.0.0.0 fr.a2dfp.net
 430.0.0.0 m.fr.a2dfp.net
 440.0.0.0 mfr.a2dfp.net
 450.0.0.0 ad.a8.net
 460.0.0.0 asy.a8ww.net
 470.0.0.0 static.a-ads.com
 480.0.0.0 atlas.aamedia.ro
 490.0.0.0 abcstats.com
 500.0.0.0 ad4.abradio.cz
 510.0.0.0 a.abv.bg
 520.0.0.0 adserver.abv.bg
 530.0.0.0 adv.abv.bg
 540.0.0.0 bimg.abv.bg
 550.0.0.0 ca.abv.bg
 560.0.0.0 track.acclaimnetwork.com
 570.0.0.0 accuserveadsystem.com
 580.0.0.0 www.accuserveadsystem.com
 590.0.0.0 achmedia.com
 600.0.0.0 csh.actiondesk.com
 610.0.0.0 ads.activepower.net
 620.0.0.0 app.activetrail.com
 630.0.0.0 stat.active24stats.nl #[Tracking.Cookie]
 640.0.0.0 traffic.acwebconnecting.com
 650.0.0.0 office.ad1.ru
 660.0.0.0 cms.ad2click.nl
 670.0.0.0 ad2games.com
 680.0.0.0 ads.ad2games.com
 690.0.0.0 content.ad20.net
 700.0.0.0 core.ad20.net
 710.0.0.0 banner.ad.nu
 720.0.0.0 adadvisor.net
 730.0.0.0 tag1.adaptiveads.com
 740.0.0.0 www.adbanner.ro
 750.0.0.0 wad.adbasket.net
 760.0.0.0 ad.pop1.adbn.ru
 770.0.0.0 ad.top1.adbn.ru
 780.0.0.0 ad.rich1.adbn.ru
 790.0.0.0 adbox.hu
 800.0.0.0 james.adbutler.de #[Tracking.Cookie]
 810.0.0.0 www.adbutler.de
 820.0.0.0 tw1.adbutler.us
 830.0.0.0 www.adchimp.com
 840.0.0.0 static.adclick.lt
 850.0.0.0 engine.adclick.lv
 860.0.0.0 show.adclick.lv
 870.0.0.0 static.adclick.lv
 880.0.0.0 www.adclick.lv
 890.0.0.0 ad-clix.com
 900.0.0.0 www.ad-clix.com
 910.0.0.0 servedby.adcombination.com
 920.0.0.0 adcomplete.com
 930.0.0.0 www.adcomplete.com
 940.0.0.0 adcore.ru
 950.0.0.0 pixel.adcrowd.com
 960.0.0.0 ct1.addthis.com
 970.0.0.0 static.uk.addynamo.com
 980.0.0.0 www.adexit.com
 990.0.0.0 s.adexpert.cz
1000.0.0.0 static.adfclick1.com
1010.0.0.0 222-33544_999.pub.adfirmative.com
1020.0.0.0 c.adfirmative.com
1030.0.0.0 www.adfirmative.com
1040.0.0.0 adfocus.ru
1050.0.0.0 adx.adform.net
1060.0.0.0 dmp.adform.net
1070.0.0.0 s1.adform.net
1080.0.0.0 server.adform.net
1090.0.0.0 track.adform.net
1100.0.0.0 server.adformdsp.net
1110.0.0.0 adforce.ru
1120.0.0.0 adforati.com
1130.0.0.0 ads.adfox.ru
1140.0.0.0 gazeta.adfox.ru
1150.0.0.0 p.adframesrc.com
1160.0.0.0 s.adframesrc.com
1170.0.0.0 media.adfrontiers.com
1180.0.0.0 www.adgitize.com
1190.0.0.0 code.ad-gbn.com
1200.0.0.0 www.ad-groups.com #[Ban Man Pro Banner Code]
1210.0.0.0 adhall.com
1220.0.0.0 pool.adhese.be
1230.0.0.0 adhitzads.com
1240.0.0.0 ads.static.adhood.com
1250.0.0.0 app.pubserver.adhood.com
1260.0.0.0 app.winwords.adhood.com
1270.0.0.0 ssl3.adhost.com
1280.0.0.0 www2.adhost.com
1290.0.0.0 adfarm1.adition.com
1300.0.0.0 imagesrv.adition.com
1310.0.0.0 ad.adition.net
1320.0.0.0 hosting.adjug.com
1330.0.0.0 tracking.adjug.com
1340.0.0.0 aj.adjungle.com
1350.0.0.0 rotator.hadj7.adjuggler.net
1360.0.0.0 thewrap.rotator.hadj7.adjuggler.net
1370.0.0.0 yorick.adjuggler.net
1380.0.0.0 adsearch.adkontekst.pl
1390.0.0.0 stat.adlabs.ru
1400.0.0.0 d.tds.adlabs.ru
1410.0.0.0 www.adlantis.jp
1420.0.0.0 publicidad.adlead.com
1430.0.0.0 www.adlimg03.com
1440.0.0.0 regio.adlink.de
1450.0.0.0 west.adlink.de
1460.0.0.0 rc.de.adlink.net #[Tracking.Cookie]
1470.0.0.0 tr.de.adlink.net
1480.0.0.0 n.admagnet.net
1490.0.0.0 ads3.adman.gr #[Tracking.Cookie]
1500.0.0.0 gazzetta.adman.gr
1510.0.0.0 r2d2.adman.gr
1520.0.0.0 talos.adman.gr
1530.0.0.0 adman.in.gr
1540.0.0.0 admarket.cz
1550.0.0.0 www.admarket.cz
1560.0.0.0 bridge.ame.admarketplace.net #[Spamdexing]
1570.0.0.0 bridge.sf.admarketplace.net
1580.0.0.0 a1.admaster.net
1590.0.0.0 img.admaster.net
1600.0.0.0 admedien.com
1610.0.0.0 www.admedien.com
1620.0.0.0 apps.admission.net #[Spotlight Ads]
1630.0.0.0 appcache.admission.net
1640.0.0.0 dt.admission.net
1650.0.0.0 view.admission.net
1660.0.0.0 ad.admitad.com
1670.0.0.0 cdn.admitad.com
1680.0.0.0 www.ad.admitad.com
1690.0.0.0 cdn.admixer.net
1700.0.0.0 ads.admodus.com #[Tracking.Cookie]
1710.0.0.0 run.admost.com
1720.0.0.0 assets3.admulti.com
1730.0.0.0 go.admulti.com
1740.0.0.0 s.admulti.com
1750.0.0.0 ads.adnet.am
1760.0.0.0 ad.adnet.biz #[Tracking.Cookie]
1770.0.0.0 adnet.com.ua
1780.0.0.0 delivery.adnetwork.vn
1790.0.0.0 img.adnet.com.tr
1800.0.0.0 www.ad-net.co.uk
1810.0.0.0 adnext.fr
1820.0.0.0 cdn.adnotch.com
1830.0.0.0 ad.adnow.com
1840.0.0.0 tt11.adobe.com #[adobe.tcliveus.com]
1850.0.0.0 ace.adoftheyear.com
1860.0.0.0 ad01.adonspot.com
1870.0.0.0 ad02.adonspot.com
1880.0.0.0 adperium.com
1890.0.0.0 adk2.adperium.com
1900.0.0.0 www.adperium.com
1910.0.0.0 img.adplan-ds.com
1920.0.0.0 res.adplus.co.id
1930.0.0.0 e.adpower.bg
1940.0.0.0 ab.adpro.com.ua
1950.0.0.0 adpublimo.com
1960.0.0.0 pop.adrent.net
1970.0.0.0 adroll.com
1980.0.0.0 rtt.adrolays.de
1990.0.0.0 n.ads1-adnow.com
2000.0.0.0 n.ads2-adnow.com
2010.0.0.0 n.ads3-adnow.com
2020.0.0.0 vu.adschoom.com
2030.0.0.0 core1.adservingfactory.com
2040.0.0.0 content.adservingfactory.com
2050.0.0.0 track.adservingfactory.com
2060.0.0.0 p78878.adskape.ru
2070.0.0.0 map2.adsniper.ru
2080.0.0.0 f-nod2.adsniper.ru
2090.0.0.0 content.adspynet.com
2100.0.0.0 engine.adspynet.com
2110.0.0.0 ads.adsready.com
2120.0.0.0 ads.adsurve.com
2130.0.0.0 www.adsurve.com
2140.0.0.0 cntr.adrime.com
2150.0.0.0 images.adrime.com #[Adsolutions]
2160.0.0.0 ad.adriver.ru
2170.0.0.0 content.adriver.ru
2180.0.0.0 ssp.adriver.ru
2190.0.0.0 r.adrolays.de
2200.0.0.0 adrotate.se
2210.0.0.0 www.adrotate.net
2220.0.0.0 delivery.ads-creativesyndicator.com
2230.0.0.0 adsafiliados.com.br
2240.0.0.0 ad.adsafiliados.com.br
2250.0.0.0 v2.adsbookie.com
2260.0.0.0 rh.adscale.de
2270.0.0.0 assets.adtaily.com
2280.0.0.0 viewster-service.adtelligence.de
2290.0.0.0 adtgs.com
2300.0.0.0 fusion.adtoma.com
2310.0.0.0 core.adunity.com
2320.0.0.0 engage2.advanstar.com
2330.0.0.0 ddnk.advertur.ru
2340.0.0.0 ds.advg.jp
2350.0.0.0 m.adx.bg
2360.0.0.0 www.adshost2.com
2370.0.0.0 js.adscale.de
2380.0.0.0 ih.adscale.de
2390.0.0.0 adscendmedia.com
2400.0.0.0 adservicedomain.info
2410.0.0.0 adserver-voice-online.co.uk
2420.0.0.0 adsfac.net #[Facilitate Tracking Code]
2430.0.0.0 adsgangsta.com
2440.0.0.0 adsfac.eu
2450.0.0.0 ad.ad-srv.net
2460.0.0.0 www.adshot.de
2470.0.0.0 f-nod1.adsniper.ru
2480.0.0.0 sync2.adsniper.ru
2490.0.0.0 cdn6.adspirit.de
2500.0.0.0 www.adspace.be
2510.0.0.0 adsplius.lt
2520.0.0.0 ads.adsponse.de
2530.0.0.0 openx.adtext.ro
2540.0.0.0 ads.adtiger.de
2550.0.0.0 www.adtiger.de
2560.0.0.0 ad.adtoma.com
2570.0.0.0 au-01.adtomafusion.com
2580.0.0.0 bn-01.adtomafusion.com
2590.0.0.0 adv.adtotal.pl #[server down?]
2600.0.0.0 rek.adtotal.pl
2610.0.0.0 www.adtrade.net
2620.0.0.0 www.adtrader.com
2630.0.0.0 adtradr.com
2640.0.0.0 ads.adtube.de
2650.0.0.0 www.adultcommercial.net
2660.0.0.0 adultmoneymakers.com
2670.0.0.0 tracking.adultsense.com
2680.0.0.0 www.adult-tracker.de
2690.0.0.0 ad.aduserver.com
2700.0.0.0 adv758968.ru
2710.0.0.0 advaction.ru
2720.0.0.0 euroad1.advantage.as
2730.0.0.0 mf.advantage.as
2740.0.0.0 mfad1.advantage.as
2750.0.0.0 adve.net
2760.0.0.0 ad.adver.com.tw
2770.0.0.0 apps.advertlets.com
2780.0.0.0 www.advertlets.com
2790.0.0.0 ads.advertise.net
2800.0.0.0 www.advertsponsor.com
2810.0.0.0 ad.adverticum.net
2820.0.0.0 img.adverticum.net
2830.0.0.0 imgs.adverticum.net
2840.0.0.0 www.advertising365.com
2850.0.0.0 titan.advertserve.com
2860.0.0.0 ad.advertstream.com
2870.0.0.0 usas1.advfn.com
2880.0.0.0 images.adviews.de
2890.0.0.0 www.adviews.de
2900.0.0.0 ad.adview.pl
2910.0.0.0 adp.adview.pl
2920.0.0.0 bi.adview.pl
2930.0.0.0 chart.advinion.com
2940.0.0.0 advizi.ru
2950.0.0.0 adv.adwish.net
2960.0.0.0 ads.adwitserver.com
2970.0.0.0 ad.adworx.at
2980.0.0.0 www.ad-z.de
2990.0.0.0 ads.afa.net
3000.0.0.0 affbeat.com
3010.0.0.0 affiliate.affdirect.com
3020.0.0.0 sttc.affiliate.hu
3030.0.0.0 tr.affiliate.hu
3040.0.0.0 img.network.affiliando.com
3050.0.0.0 view.network.affiliando.com
3060.0.0.0 ads.affiliateclub.com
3070.0.0.0 affiliategroove.com
3080.0.0.0 banners.affiliatefuture.com
3090.0.0.0 images.affiliator.com
3100.0.0.0 imp.affiliator.com
3110.0.0.0 rotation.affiliator.com
3120.0.0.0 media.affiliatelounge.com
3130.0.0.0 js.affiliatelounge.com
3140.0.0.0 record.affiliatelounge.com
3150.0.0.0 web1.affiliatelounge.com
3160.0.0.0 banners.affilimatch.de
3170.0.0.0 ad.afilo.pl
3180.0.0.0 adserwer.afilo.pl
3190.0.0.0 ads.afraccess.com
3200.0.0.0 ads.aftonbladet.se
3210.0.0.0 stats.agent.co.il
3220.0.0.0 stats.agentinteractive.com
3230.0.0.0 w.ahalogy.com
3240.0.0.0 ac.ajur.info #[WebBug]
3250.0.0.0 openx.ajur.info
3260.0.0.0 adlik2.akavita.com
3270.0.0.0 dmtracking2.alibaba.com
3280.0.0.0 all2lnk.com
3290.0.0.0 ads.allaccess.com.ph
3300.0.0.0 adcontent2.allaccess.com.ph
3310.0.0.0 adservice.aliexpress.com
3320.0.0.0 ad.allstar.cz
3330.0.0.0 taobaoafp.allyes.cn
3340.0.0.0 bokee.allyes.com
3350.0.0.0 demoafp.allyes.com
3360.0.0.0 eastmoney.allyes.com
3370.0.0.0 smarttrade.allyes.com
3380.0.0.0 sroomafp.allyes.com
3390.0.0.0 taobaoafp.allyes.com
3400.0.0.0 tom.allyes.com
3410.0.0.0 uuseeafp.allyes.com
3420.0.0.0 yeskyafp.allyes.com
3430.0.0.0 eas.almamedia.fi
3440.0.0.0 ad.altervista.org
3450.0.0.0 pqwaker.altervista.org
3460.0.0.0 adimg.alice.it
3470.0.0.0 adv.alice.it
3480.0.0.0 advloc.alice.it
3490.0.0.0 altmedia101.com
3500.0.0.0 www.alwayson-network.com
3510.0.0.0 adtools2.amakings.com
3520.0.0.0 banner.amateri.cz
3530.0.0.0 amazing-offers.co.il
3540.0.0.0 ad.amgdgt.com
3550.0.0.0 adserver.amna.gr
3560.0.0.0 10394-127.ampxchange.com #[Spamdexing]
3570.0.0.0 10394-4254.ampxchange.com
3580.0.0.0 10394-2468.ampxchange.com
3590.0.0.0 vfdeprod.amobee.com
3600.0.0.0 widgets.amung.us
3610.0.0.0 whos.amung.us #[WebBug]
3620.0.0.0 analytics.analytics-egain.com
3630.0.0.0 cloud-us.analytics-egain.com
3640.0.0.0 gw.anametrix.net #[WebBug]
3650.0.0.0 www.anastasiasaffiliate.com
3660.0.0.0 advert.ananzi.co.za
3670.0.0.0 advert2.ananzi.co.za
3680.0.0.0 box.anchorfree.net
3690.0.0.0 rpt.anchorfree.net
3700.0.0.0 a.androidandme.com
3710.0.0.0 analytics.androidandme.com #[Piwik.Analytics]
3720.0.0.0 www.anticlown.com
3730.0.0.0 antventure.com
3740.0.0.0 webtracker.apicasystem.com
3750.0.0.0 junior.apk.net
3760.0.0.0 openx.apollo.lv
3770.0.0.0 ads.asia1.com.sg
3780.0.0.0 ads.ask.com #[sv-click.looksmart.com]
3790.0.0.0 www.asknew.com #[Spamdexing]
3800.0.0.0 stats.asp24.pl
3810.0.0.0 ads.aspalliance.com
3820.0.0.0 www.astalavista.us
3830.0.0.0 atemda.com
3840.0.0.0 logw349.ati-host.net
3850.0.0.0 rules.atgsvcs.com
3860.0.0.0 logw312.ati-host.net
3870.0.0.0 p.ato.mx
3880.0.0.0 s.ato.mx
3890.0.0.0 ads.auctionads.com
3900.0.0.0 banners.audioholics.com
3910.0.0.0 ad.auditude.com
3920.0.0.0 ads.auctioncity.co.nz
3930.0.0.0 d.audienceiq.com
3940.0.0.0 ads.autoscout24.com
3950.0.0.0 ads.autotrader.com
3960.0.0.0 adserving.autotrader.com
3970.0.0.0 profiling.avandor.com
3980.0.0.0 avantlink.com
3990.0.0.0 www.avantlink.com
4000.0.0.0 fhg.avrevenue.com #[server down?]
4010.0.0.0 rev.avsforum.com
4020.0.0.0 ads.avusa.co.za
4030.0.0.0 engine.awaps.net
4040.0.0.0 analytics.aweber.com
4050.0.0.0 clicks.aweber.com #[affects newsletters]
4060.0.0.0 tracker.azet.sk
4070.0.0.0 www.azmsoft.com

Referência

Translations: