Forcing Google Services to local (RSA) IP address

Pada

Executive Member
#1
As some of you might have seen: Google, YouTube and Facebook are hosting local mirrors for most of their services.
Unfortunately the ISP's DNS servers doesn't always report the local IP addresses, even if the services work on the local mirrors!

There are 2 ways in which you can force the Google, YouTube & Facebook to work on local cap:
  1. Forcing the hostnames to a fixed IP address with the use of the hosts file, which can be found in the %windir%\system32\drivers\etc folder.
    Pros: very easy and quick to setup
    Cons: doesn't support wildcards or multiple hostnames, which is why the list is so massive
    * Instructions at the bottom
    * NEW!!: There's a hosts file modification specific to YouTube viewers on the SAIX network too - see bottom of post
    * NEW #2!!: There are also hosts file modifications for Google views on WebAfrica network - see Tinuva's post
  2. Running your own DNS server with the use of BIND9 and then overriding the hostnames using wildcards.
    Pros: supports regular expressions (wildcards); 1 server can be used for multiple PC's; would override more Google & YouTube services (Facebook zone not added yet); this technique works on some routers too
    Cons: the setup takes a couple of minutes to do and might seem like its for advanced users
    * Instructions can be found on my blog: http://mybroadband.co.za/vb/entry.p...n-Windows-for-accessing-local-Google-services


Modifying the hosts file can be done like follow:
  1. Run: notepad %windir%\system32\drivers\etc\hosts
    ^^ Its really as simple as pressing Windows Key + R, typing in notepad %windir%\system32\drivers\etc\hosts and pressing Enter
    If you don't understand that, then you can open notepad, browse to c:\windows\system32\drivers\etc folder and then open the file with the name hosts
  2. Here's the list that you'll have to add to the bottom of the hosts file:
    Code:
    # 
    # Thanks goes to Catal, HavocXphere, Blogbytes & fragtion_ for contributing hostnames
    #
    
    # On SAIX:
    # <Google IP> = 165.165.38.147
    # <YouTube IP> = 165.165.38.144
    # <Facebook IP> = 165.165.39.200 / 165.165.39.202 / 165.165.39.203
    
    # On IS:
    # <Google IP> = 196.23.168.147
    # <YouTube IP> = 196.23.168.144 / 196.23.168.145 / 196.23.168.155 / 196.23.168.154
    # <Facebook IP> = 196.33.166.201 / 196.33.166.210 / 196.36.108.168 / 196.36.108.171
    
    # Google Searching
    <Google IP> www.google.co.za
    <Google IP> www.google.com
    <Google IP> google.com
    <Google IP> google.co.za
    
    # Gmail and chat withing Gmail
    <Google IP> mail.google.com
    <Google IP> chatenabled.mail.google.com
    
    # Google Code & Pada's Traffic Splitter Google Code address
    <Google IP> www.gmodules.com
    <Google IP> traffic-splitter.googlecode.com
    <YouTube IP> www.googlecode.com
    <YouTube IP> code.google.com
    
    # Blogspot
    <Google IP> www.blogspot.com
    <Google IP> bp0.blogger.com
    <Google IP> bp1.blogger.com
    <Google IP> bp2.blogger.com
    <Google IP> bp3.blogger.com
    <Google IP> 0.bp.blogspot.com
    <Google IP> 1.bp.blogspot.com
    <Google IP> 2.bp.blogspot.com
    <Google IP> 3.bp.blogspot.com
    <Google IP> 4.bp.blogspot.com
    <Google IP> image.blogspot.com
    <Google IP> buttons.blogger.com
    <Google IP> upload.blogspot.com
    <Google IP> googleappengine.blogspot.com
    <Google IP> www.blogger.com
    <Google IP> www.blogblog.com
    <Google IP> img1.blogblog.com
    <Google IP> img2.blogblog.com
    <Google IP> www1.blogblog.com
    <Google IP> www2.blogblog.com
    
    # Google Eath & Google Maps
    <Google IP> maps.google.co.za
    <Google IP> maps.google.com
    <Google IP> csi.gstatic.com
    <Google IP> maps.gstatic.com
    <Google IP> gg.google.com
    <YouTube IP> kh.google.com
    <YouTube IP> mw1.google.com
    <YouTube IP> mw2.google.com
    <YouTube IP> earth.google.com
    <YouTube IP> mt0.google.com
    <YouTube IP> mt1.google.com
    <YouTube IP> mt2.google.com
    <YouTube IP> mt3.google.com
    <YouTube IP> khm.google.com
    <YouTube IP> cbk0.google.com
    <YouTube IP> cbk1.google.com
    <YouTube IP> cbk2.google.com
    <YouTube IP> cbk3.google.com
    
    # Other Google Services
    <Google IP> news.google.com
    <Google IP> blitz.appspot.com
    <Google IP> www.google-analytics.com
    <Google IP> ssl.google-analytics.com
    <Google IP> t0.gstatic.com
    <Google IP> t1.gstatic.com
    <Google IP> t2.gstatic.com
    <Google IP> t3.gstatic.com
    <Google IP> www.gstatic.com
    <YouTube IP> books.google.co.za
    <YouTube IP> books.google.com
    <YouTube IP> calendar.google.com
    <YouTube IP> video.google.com
    <YouTube IP> translate.google.com
    <YouTube IP> docs.google.com
    <YouTube IP> appengine.google.com
    <YouTube IP> clients1.google.com
    <YouTube IP> clients2.google.com
    <YouTube IP> clients3.google.com
    <YouTube IP> clients4.google.com
    <YouTube IP> clients5.google.com
    <YouTube IP> id.google.com
    <YouTube IP> dl.google.com
    
    # YouTube
    <Google IP> ad-emea.doubleclick.net
    <Google IP> s.ytimg.com
    <Google IP> webcache.googleusercontent.com
    <YouTube IP> youtube.co.za
    <YouTube IP> youtube.com
    <YouTube IP> www.youtube.co.za
    <YouTube IP> www.youtube.com
    <YouTube IP> www.youtube-nocookie.com
    <YouTube IP> i1.ytimg.com
    <YouTube IP> i2.ytimg.com
    <YouTube IP> i3.ytimg.com
    <YouTube IP> i4.ytimg.com
    <YouTube IP> upload.youtube.com
    
    # Facebook
    <Facebook IP> www.facebook.com
    <Facebook IP> static.ak.fbcdn.net
    <Facebook IP> profile.ak.fbcdn.net
    <Facebook IP> upload.facebook.com
  3. Replace (please make use of the Replace... [CTRL + H] function) the <Google IP>, <YouTube IP> and <Facebook IP> with the correct IP address, which I've given at the top of the list.
    If I've specified multiple IP addresses, using a / to separate them, please just pick one random one from the list.
    Please use the IP addresses according to your local ISP: SAIX/IS !
  4. Save the file and exit notepad. You don't need to restart for it to take effect.

If you're having trouble with either a Google, YouTube of Facebook page, then I would appreciate it if you can give me as much information as possible:
  • Overriding method that you're using
  • ISP account name
  • URL that's not working on local cap
  • ping results to the hostname specified by the URL (for intermediate/advanced users)
  • the DNS server's IP address that you're using (for intermediate/advanced users)

eg.
  • Overriding method: hosts file
  • ISP account name:Mweb consumer uncapped
  • URL: https://mail.google.com/mail/?shva=1
  • Ping results:
    Code:
    C:\Users\xxx>ping mail.google.com
    
    Pinging googlemail.l.google.com [74.125.45.17] with 32 bytes of data:
    Reply from 74.125.45.17: bytes=32 time=366ms TTL=47
    Reply from 74.125.45.17: bytes=32 time=365ms TTL=47
    Reply from 74.125.45.17: bytes=32 time=366ms TTL=47
    Reply from 74.125.45.17: bytes=32 time=369ms TTL=47
    
    Ping statistics for 74.125.45.17:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 365ms, Maximum = 369ms, Average = 366ms
  • DNS Server IP address: 196.25.1.11

A few notes when forcing the Google services to the local IP address:
  1. I haven't managed to get Google Talk working yet
  2. I found Google Earth to be quite slow

Here are the results of people trying to ping www.google.co.za without forcing it to the local IP address: http://mybroadband.co.za/vb/showthread.php?241552-Your-help-needed-Please-ping-www.Google.co.za

If you've found more cool Google services that are mirrored locally, please contribute :)

NEW!!!
Hosts file modification specifically for YouTube viewers on SAIX network:
http://pastebin.com/ra85gsiW * Thank Fragtion for this
If you're to cheap to have international bandwidth left to even view that, you can download the contents here: http://www.quickshare.co.za/files/kyq9it0k/YouTube-SAIX-31Aug2010.txt.html
 
Last edited:

Yuu

Expert Member
#10
Quick question regarding gmail

@ Mr Pada

Why after adding the Gmail ips did mine stop working after 1 day, i only login to my TK accounts using my router (NO Dialing up as such) and only the search works however i am adding the google earth stuff now into my localhosts file to see if those work aswell.

Rather odd but i will test further otherwise thanks soo much for showing us how to do this :)

Edit:

I removed the previous line i created and re-added the above lines and it seems to be working, maybe a dns issue no idea but its working :)
 
Last edited:

Pada

Executive Member
#11
Yuu, thats strange that you've had trouble with it.

If you've set these static DNS entries on the router, then ensure that you clear your PC's DNS cache.
In Windows you can do that by running: ipconfig /flushdns
 

Yuu

Expert Member
#12
Thanks Pada, for now its working well but i will continue to test as the weeks go by :)

This thread should be stickied already :)
 

Pada

Executive Member
#17
One thing that I forgot to mention, which you might run into, is the invalid X.509 certificate error that Firefox/IE would warn you about.
So far I've only had this issue with Google Code (when trying to upload to SVN) and not when accessing Gmail.
 

Catal

Well-Known Member
#19
Updated list with Youtube

This is great news, thx pada. We love Google! :love:

I've added a few more hosts to get stuff like maps and images working. Some of the youtube video's also work, e.g. http://www.youtube.com/watch?v=lz55TaFKNZw&feature=channel . I haven't been very elegant in collecting the host names, some might even be wrong, so I'm sure your lists look much more impressive than mine :D I use Telkom DoBroadband1 with only local cap left.

Code:
# Google Searching
196.23.168.147 www.google.co.za
196.23.168.147 www.l.google.com
196.23.168.147 www.google.com

# Gmail and chat withing Gmail
196.23.168.147 mail.google.com
196.23.168.147 chatenabled.mail.google.com

# Google Code & Pada's Traffic Splitter Google Code address
196.23.168.147 code.google.com
196.23.168.147 traffic-splitter.googlecode.com
196.23.168.147 www.gmodules.com

# Google Earth
196.23.168.147 kh.google.com
196.23.168.147 kh.l.google.com
196.23.168.147 csi.gstatic.com
196.23.168.147 csi.l.google.com
196.23.168.147 mw1.google.com
196.23.168.147 mw2.google.com
196.23.168.147 mw-small.l.google.com
196.23.168.147 mw-medium.l.google.com
196.23.168.147 earth.google.com

# Google Services
196.23.168.147 books.google.co.za
196.23.168.147 calendar.google.com
196.23.168.147 video.google.com
196.23.168.147 news.google.com
196.23.168.147 translate.google.com
196.23.168.147 docs.google.com

# Google Appengine
196.23.168.147 blitz.appspot.com
196.23.168.147 appengine.google.com
196.23.168.147 www.google-analytics.com
196.23.168.147 ssl.google-analytics.com

# Blogspot
196.23.168.147 googleappengine.blogspot.com
196.23.168.147 www.blogger.com

# Google Handling Servers
196.23.168.147 clients0.google.com
196.23.168.147 clients1.google.com
196.23.168.147 clients2.google.com
196.23.168.147 clients3.google.com
196.23.168.147 id.google.com
196.23.168.147 dl.google.com
196.23.168.147 t0.gstatic.com
196.23.168.147 t1.gstatic.com
196.23.168.147 t2.gstatic.com
196.23.168.147 t3.gstatic.com
196.23.168.147 www.gstatic.com

# Google Maps
196.23.168.147 maps.google.co.za
196.23.168.147 maps.google.com
196.23.168.147 mt0.google.com
196.23.168.147 mt1.google.com
196.23.168.147 maps.gstatic.com
196.23.168.147 khm.google.com
196.23.168.147 gg.google.com
196.23.168.147 cbk0.google.com
196.23.168.147 cbk1.google.com
196.23.168.147 cbk2.google.com
196.23.168.147 cbk3.google.com

# Youtube (Just testing)
196.23.168.147 www.youtube.com
196.23.168.147 www.youtube.co.za
196.23.168.147 youtube-ui.l.google.com
196.23.168.147 s.ytimg.com
196.23.168.147 www.youtube-nocookie.com
196.23.168.147 pagead0.googlesyndication.com
196.23.168.147 pagead1.googlesyndication.com
196.23.168.147 pagead2.googlesyndication.com
196.23.168.147 pagead3.googlesyndication.com
196.23.168.147 webcache.googleusercontent.com
196.23.168.147 0.tqn.com
196.23.168.147 ad-emea.doubleclick.net
196.23.168.147 i0.ytimg.com
196.23.168.147 i1.ytimg.com
196.23.168.147 i2.ytimg.com
196.23.168.147 i3.ytimg.com
196.23.168.147 i4.ytimg.com
196.23.168.147 csi.google.com
 

Pada

Executive Member
#20
Wow Catal, your list is massive. Thanks for your effort, as I'm sure many would love to make use of it :D
I would certainly test a few of those.

The Google Analytics one would be very useful for me, since many local sites use it for tracking users.
 
Last edited:
Top