Forcing Google Services to local (RSA) IP address

bobthedinosaur: if you've followed my previous post, then you won't have to add that many entries in the hosts file, since ALL the Google & YouTube webpages would go through that single local IP address.

Fragtion & I are still wondering whether we should host local DNS servers for you guys on SAIX/IS networks so that you can enjoy Google, Facebook & YouTube on local cap...
We probably could've hosted it on a 384kbps line, but the problem is that we require static IP addresses on both the SAIX & IS networks.
 
Tinuva: the reason why we want to host on both networks would be so that we can request non-Google/Facebook/YouTube DNS records from the respective networks' DNS servers.
Say for instance you're going to host the DNS server on IS, then you're not going to be able to request DNS records from a SAIX DNS server. eg.
** server can't find us.download.nvidia.com: REFUSED

I wonder if WebAfrica has their own local IP addresses for these Akamai & Google servers too?

I just did a few queries on us.download.nvidia.com which should report a local IP address, but it didn't in all the cases!

SAIX DNS server reports local SAIX IP address:
Server: 196.25.1.11
Address: 196.25.1.11#53

Non-authoritative answer:
us.download.nvidia.com canonical name = us.download.nvidia.com.edgesuite.net.
us.download.nvidia.com.edgesuite.net canonical name = a1437.d.akamai.net.
Name: a1437.d.akamai.net
Address: 165.165.37.19
Name: a1437.d.akamai.net
Address: 165.165.37.17

IS DNS server reports international IP address:
Server: 196.14.239.2
Address: 196.14.239.2#53

Non-authoritative answer:
us.download.nvidia.com canonical name = us.download.nvidia.com.edgesuite.net.
us.download.nvidia.com.edgesuite.net canonical name = a1437.d.akamai.net.
Name: a1437.d.akamai.net
Address: 92.122.127.26
Name: a1437.d.akamai.net
Address: 92.122.126.233

Stellenbosch University / TENET DNS server reports local IP address:
Server: 146.232.128.10
Address: 146.232.128.10#53

Non-authoritative answer:
us.download.nvidia.com canonical name = us.download.nvidia.com.edgesuite.net.
us.download.nvidia.com.edgesuite.net canonical name = a1437.d.akamai.net.
Name: a1437.d.akamai.net
Address: 196.14.182.142
Name: a1437.d.akamai.net
Address: 196.14.182.136
 
If you regularly change between an IS and a Telkom/SAIX connection, here are two simple scripts to run that will remove and update the static entries on a Mikrotik router. As an added bonus, if the respective IP addresses change you only have to update each script in one place.

Call this script update_saix_dns_ip or whatever tickles your fancy;
#Use this for SAIX/Telkom

:global saixdnsip 165.165.38.147

/ip dns static remove [find where ttl=1d1s]

/ip dns static add disabled=no ttl=1d1s comment="Google Searching" address=$saixdnsip name=www.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Searching" address=$saixdnsip name=google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Searching" address=$saixdnsip name=google.co.za

/ip dns static add disabled=no ttl=1d1s comment="Gmail and chat withing Gmail" address=$saixdnsip name=googlemail.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Gmail and chat withing Gmail" address=$saixdnsip name=gmail.com
/ip dns static add disabled=no ttl=1d1s comment="Gmail and chat withing Gmail" address=$saixdnsip name=b.googlemail.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Gmail code and traffic splitter" address=$saixdnsip name=code.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Gmail code and traffic splitter" address=$saixdnsip name=traffic-splitter.googlecode.com
/ip dns static add disabled=no ttl=1d1s comment="Gmail code and traffic splitter" address=$saixdnsip name=googlehosted.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Other Google Services" address=$saixdnsip name=video.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Other Google Services" address=$saixdnsip name=news.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Other Google Services" address=$saixdnsip name=writely.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Google App Engine" address=$saixdnsip name=appspot.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google App Engine" address=$saixdnsip name=www-google-analytics.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google App Engine" address=$saixdnsip name=ssl-google-analytics.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Blogspot" address=$saixdnsip name=blogspot.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Blogspot" address=$saixdnsip name=blogger.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$saixdnsip name=www3.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$saixdnsip name=www2.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=196.23.168.144 name=clients.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$saixdnsip name=id.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$saixdnsip name=dl.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$saixdnsip name=tbn.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Google Earth" address=$saixdnsip name=kh.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Earth" address=$saixdnsip name=csi.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Earth" address=$saixdnsip name=mw-small.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Earth" address=$saixdnsip name=mw-medium.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Google Maps" address=$saixdnsip name=maps.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Maps" address=$saixdnsip name=mt.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Maps" address=$saixdnsip name=khm.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Maps" address=$saixdnsip name=cbk.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$saixdnsip name=youtube-ui.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$saixdnsip name=static.cache.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$saixdnsip name=cs.about.akadns.net
/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$saixdnsip name=dart.l.doubleclick.net
/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$saixdnsip name=ytimg.l.google.com

Call this script update_is_dns_ip or whatever you like;
#Use this for Internet Solutions

:global isdnsip 196.23.168.147

/ip dns static remove [find where ttl=1d1s]

/ip dns static add disabled=no ttl=1d1s comment="Google Searching" address=$isdnsip name=www.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Searching" address=$isdnsip name=google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Searching" address=$isdnsip name=google.co.za

/ip dns static add disabled=no ttl=1d1s comment="Gmail and chat withing Gmail" address=$isdnsip name=googlemail.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Gmail and chat withing Gmail" address=$isdnsip name=gmail.com
/ip dns static add disabled=no ttl=1d1s comment="Gmail and chat withing Gmail" address=$isdnsip name=b.googlemail.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Gmail code and traffic splitter" address=$isdnsip name=code.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Gmail code and traffic splitter" address=$isdnsip name=traffic-splitter.googlecode.com
/ip dns static add disabled=no ttl=1d1s comment="Gmail code and traffic splitter" address=$isdnsip name=googlehosted.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Other Google Services" address=$isdnsip name=video.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Other Google Services" address=$isdnsip name=news.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Other Google Services" address=$isdnsip name=writely.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Google App Engine" address=$isdnsip name=appspot.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google App Engine" address=$isdnsip name=www-google-analytics.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google App Engine" address=$isdnsip name=ssl-google-analytics.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Blogspot" address=$isdnsip name=blogspot.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Blogspot" address=$isdnsip name=blogger.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$isdnsip name=www3.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$isdnsip name=www2.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=196.23.168.144 name=clients.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$isdnsip name=id.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$isdnsip name=dl.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Handling Servers" address=$isdnsip name=tbn.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Google Earth" address=$isdnsip name=kh.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Earth" address=$isdnsip name=csi.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Earth" address=$isdnsip name=mw-small.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Earth" address=$isdnsip name=mw-medium.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Google Maps" address=$isdnsip name=maps.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Maps" address=$isdnsip name=mt.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Maps" address=$isdnsip name=khm.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Google Maps" address=$isdnsip name=cbk.l.google.com

/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$isdnsip name=youtube-ui.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$isdnsip name=static.cache.l.google.com
/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$isdnsip name=cs.about.akadns.net
/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$isdnsip name=dart.l.doubleclick.net
/ip dns static add disabled=no ttl=1d1s comment="Youtube" address=$isdnsip name=ytimg.l.google.com

Then call the relevant script whenever you change ADSL accounts.

Hope this helps someone.
 
Last edited:
hilton: thanks for the MikroTik script. Unfortunately the MikroTik can't use static DNS entries with regular expressions in recursive lookups. Like if you were to add *.l.google.com, it won't match a lookup for googlemail.google.com, even if its pointing to googlemail.l.google.com.
However, if you add all the something.l.google.com entries (like you've done), then it works with recursive entries.
I'm not sure if this applies to version 4 or 5 beta, but it's definitely like this on v3.30 :(

Another alternative, which might be less entries, would be to add a *.google.com, *.google.co.za, *.youtube.com, *.youtube.co.za, *.blogspot.com and *.blogger.com
eg.
Code:
:global googleip 196.23.168.147
/ip dns static
add name=".*\\.google\\.com" address=$googleip ttl=1d1s
add name=".*\\.google\\.co.za" address=$googleip ttl=1d1s
add name=".*\\.youtube\\.com" address=$googleip ttl=1d1s
add name=".*\\.youtube\\.co.za" address=$googleip ttl=1d1s
add name=".*\\.blogspot\\.com" address=$googleip ttl=1d1s
add name=".*\\.blogger\\.com" address=$googleip ttl=1d1s
 
Pada said:
Tinuva: the reason why we want to host on both networks would be so that we can request non-Google/Facebook/YouTube DNS records from the respective networks' DNS servers.
Say for instance you're going to host the DNS server on IS, then you're not going to be able to request DNS records from a SAIX DNS server. eg.
Actually, you can still run it on the same server and IP, just use a DNS server that will report different IPs based on the source IP querying it. Also instead of using a specific ISP dns server to do the lookups, you can do full lookups yourself. But don;t let me tell you how to do it, this is the internet you are open to do it however you want, just thought it be nice to help you save money on hosting 2 servers.

Pada said:
I wonder if WebAfrica has their own local IP addresses for these Akamai & Google servers too?
Not exactly their own, but you can test against their DNS servers, 196.220.59.188,196.220.59.189
 
Another alternative, which might be less entries, would be to add a *.google.com, *.google.co.za, *.youtube.com, *.youtube.co.za, *.blogspot.com and *.blogger.com
eg.
Code:
:global googleip 196.23.168.147
/ip dns static
add name=".*\\.google\\.com" address=$googleip ttl=1d1s

Yeah this would be better but I just left all the entries so people could reference all your good work.
 
What am i doing wrong

I edit the windows/system32/drivers/etc/host but nothing none of the stuff work here's what I've done.
3# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

# Google Searching (thanks to HavocXphere and Blogbytes)
165.165.38.147 www.l.google.com
165.165.38.147 google.com
165.165.38.147 google.co.za

# Gmail and chat withing Gmail
165.165.38.147 googlemail.l.google.com
165.165.38.147 gmail.com
165.165.38.147 b.googlemail.l.google.com

# Google Code & Pada's Traffic Splitter Google Code address (thanks to Catal)
165.165.38.147 code.l.google.com
165.165.38.147traffic-splitter.googlecode.com
165.165.38.147 googlehosted.l.google.com

# Other Google Services (thanks to Catal)
165.165.38.147 video.l.google.com
165.165.38.147 news.l.google.com
165.165.38.147 writely.l.google.com

# Google Appengine (thanks to Catal)
165.165.38.147 appspot.l.google.com
165.165.38.147 www-google-analytics.l.google.com
165.165.38.147 ssl-google-analytics.l.google.com

# Blogspot (thanks to Catal)
165.165.38.147 blogspot.l.google.com
165.165.38.147 blogger.l.google.com
165.165.38.147 bloggerphotos.l.google.com

# Google Handling Servers (thanks to Catal)
165.165.38.147 www3.l.google.com
165.165.38.147 www2.l.google.com
165.165.38.147 clients.l.google.com
165.165.38.147 id.l.google.com
165.165.38.147 dl.l.google.com
165.165.38.147 tbn.l.google.com

# Google Earth (thanks to Catal)
165.165.38.147 kh.google.com
165.165.38.147 csi.l.google.com
165.165.38.147 mw-small.l.google.com
165.165.38.147 mw-medium.l.google.com

# Google Maps (thanks to Catal)
165.165.38.147 maps.l.google.com
165.165.38.147 mt.l.google.com
165.165.38.147 khm.l.google.com
165.165.38.147 cbk.l.google.com

# Youtube (thanks to Catal)
165.165.38.147 youtube-ui.l.google.com
165.165.38.147 static.cache.l.google.com
165.165.38.147 cs.about.akadns.net
165.165.38.147 dart.l.doubleclick.net
165.165.38.147 ytimg.l.google.com
 
Last edited:
mmmig, you must explain to us what is going wrong? Like are you trying to access Gmail / Facebook / YouTube?
Also give us the exact URL that you're trying to use.

Also: you'll have to use a different list, because I've clearly stated that that list will NOT work, which is why I said you should use Catal's list instead.
 
mmmig, you must explain to us what is going wrong? Like are you trying to access Gmail / Facebook / YouTube?
Also give us the exact URL that you're trying to use.

Also: you'll have to use a different list, because I've clearly stated that that list will NOT work, which is why I said you should use Catal's list instead.
I've edited my original post
 
mmmmig, save ur hosts file after editing, then reboot ur pc. You have to reboot or it won't work
 
mmmmig, save ur hosts file after editing, then reboot ur pc. You have to reboot or it won't work
Now you're just helping the man from the wall into the pit: you don't have to restart your PC for changes made to the hosts file! I hope for your part that you were sarcastic :)

mmmig:
* (updated) Note: this list won't work correctly under Linux/Windows! Instead, use both my list and Catal's list combined. You can remove the duplicate hostnames yourself (or wait until I merge them in the next few days).
 
sincerious, could you perhaps elaborate on which method you used (BIND9 server / hosts file [including if you used my/Catal's list]) and provide proof, like a screenshot or nslookup results?! Also give us the ISP account type that you're using.
 
sincerious, could you perhaps elaborate on which method you used (BIND9 server / hosts file [including if you used my/Catal's list]) and provide proof, like a screenshot or nslookup results?! Also give us the ISP account type that you're using.

thanks for replying, pada ;)

method used: located my 'hosts' file manually and opened it in notepad

list used: the one meant for windows (catal's)

isp account type: not sure exactly what you mean, but if you mean shaped or unshaped - it's telkom shaped

proof: see bold parts in list hereunder - added to my hosts file on 26/7/2010 and deleted on 27/7/2010 as changes did not seem to do anything for me...

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost

# Google Searching (thanks to HavocXphere and Blogbytes)

196.23.168.147 www.l.google.com
196.23.168.147 google.com
196.23.168.147 google.co.za

# Gmail and chat withing Gmail

196.23.168.147 googlemail.l.google.com
196.23.168.147 gmail.com
196.23.168.147 b.googlemail.l.google.com

# Google Code & Pada's Traffic Splitter Google Code address (thanks to Catal)

196.23.168.147 code.l.google.com
196.23.168.147 traffic-splitter.googlecode.com
196.23.168.147 googlehosted.l.google.com

# Other Google Services (thanks to Catal)

196.23.168.147 video.l.google.com
196.23.168.147 news.l.google.com
196.23.168.147 writely.l.google.com

# Google Appengine (thanks to Catal)

196.23.168.147 appspot.l.google.com
196.23.168.147 www-google-analytics.l.google.com
196.23.168.147 ssl-google-analytics.l.google.com

# Blogspot (thanks to Catal)

196.23.168.147 blogspot.l.google.com
196.23.168.147 blogger.l.google.com
196.23.168.147 bloggerphotos.l.google.com

# Google Handling Servers (thanks to Catal)

196.23.168.147 www3.l.google.com
196.23.168.147 www2.l.google.com
196.23.168.144 clients.l.google.com
196.23.168.147 id.l.google.com
196.23.168.147 dl.l.google.com
196.23.168.147 tbn.l.google.com

# Google Earth (thanks to Catal)

196.23.168.147 kh.google.com
196.23.168.147 csi.l.google.com
196.23.168.147 mw-small.l.google.com
196.23.168.147 mw-medium.l.google.com

# Google Maps (thanks to Catal)

196.23.168.147 maps.l.google.com
196.23.168.147 mt.l.google.com
196.23.168.147 khm.l.google.com
196.23.168.147 cbk.l.google.com

# Youtube (thanks to Catal)

196.23.168.147 youtube-ui.l.google.com
196.23.168.147 static.cache.l.google.com
196.23.168.147 cs.about.akadns.net
196.23.168.147 dart.l.doubleclick.net
196.23.168.147 ytimg.l.google.com


if i've done anything wrong, please don't shout at me... i'm just a noob...ette, ok! :p
 
Ai sincerious. You're contradicting yourself :D
You said you're using Catal's list, yet you're using my "faulty" one...
I think I'm just going to merge my list now, since too many people are using mine - either they're too hasty, dyslexic or just plain illiterate :D

The ISP account type that I was asking for you answered 100%. I actually wanted to know the DNS server's address too, but that's asking too much from most people.
It seems like YouTube & Google DNS queries to the SAIX DNS server returns local IP addresses again, but not for Facebook.

I'm still wondering why no one has attempted to run the BIND9 DNS server, since its definitely a better solution than modifying the hosts file!
 
Ai sincerious. You're contradicting yourself :D
You said you're using Catal's list, yet you're using my "faulty" one...
I think I'm just going to merge my list now, since too many people are using mine - either they're too hasty, dyslexic or just plain illiterate :D

The ISP account type that I was asking for you answered 100%. I actually wanted to know the DNS server's address too, but that's asking too much from most people.
It seems like YouTube & Google DNS queries to the SAIX DNS server returns local IP addresses again, but not for Facebook.

I'm still wondering why no one has attempted to run the BIND9 DNS server, since its definitely a better solution than modifying the hosts file!

ok then, i am through-each-other... although all these instructions and different threads are also quite deurmekaar, ne! :p
yes, please merge your list.
i've checked in my tcp/ip what what thingy and no dns server address is specified - it's set to "obtain dns server address automatically"
binds9 is probably too complicated... well, for me it is :D

edit: and i am mos capped, so i cannot download the latest bind! :)
 
Last edited:
Last edited:
Top
Sign up to the MyBroadband newsletter
X