Geographic server assignment/routing in DNS

Correctly setting up routes in DNS for geographically clustered servers or proxies is a challenging task.

There are quite simply many countries out there, and a big chunk of those are small enough to draw no or little transfer, and overseas Internet cables and Internet routing isn’t mapped or documented too well.

To correctly assign a server to a country in DNS for best performances I’ve been using a fairly simple technique. In Google Earth I made a KML map for the locations of servers and I use Google Earth to inspect the regions surrounding a server. I search Google for the name of the country in question and the keywords “ip address” for example “new caledonia ip address” and the results will give me a list of subnets assigned in those countries. I can then use traceroute on each of the servers to determine the lowest latency and then devise the best approach to routing.

Seems to work quite well its just a tedious job of locating other parts of the world and determining your best connectivity to those locations.

Posting to a Facebook Page on a schedule

I regularly post computer news stories to a Facebook page for my business and recently I setup link tracking via a HTTP 302 redirection to track the performance of my Facebook posts.

I’ve noticed that posts are more successful at particular times of the day which I’ll call “peak periods”.

The peak periods I’ve observed are:

  • Morning (before work?)
  • Lunch time
  • Evenings (around 5-7pm)
  • Late Evenings (irregular but if occurs happens at 8-10pm)
  • Friday & Saturday Nights (often starts in the late afternoon and ends as late as 10pm)
  • Sunday afternoons

So I decided I needed to post at a schedule to make full advantage of my Facebook posts.

I discovered that HootSuite offers such functionality, for free, although it is ad supported. However I’m yet to see any ads so I’m not sure what they mean by that.

I also considered that the pages for the radio stations I deal with could take advantage of such a system. Maybe a post 15 minutes before the start of a show saying the show is coming on next.

Adding robots.txt to Icecast

I noticed today that my Icecast servers are getting hit by Google quite regularly. Strange because there isn’t really any indexable content.

So today I added a robots.txt to Icecast in /usr/share/icecast2/web on Debian systems. I disallowed all robots with:

User-agent: *

Disallow: /

So hopefully I won’t get robots on my Icecast server. This would also protect against people using wget to record streams, as wget will honour robots.txt.

My drama with Virtual Machines

Well I was really hoping to migrate from iWeb this month but unfortunately Jumba don’t have any virtual machines. I called them this morning and they told me they’d take new accounts in mid September.

So I’m left having to migrate from iWeb in the next 2 days with no destination. My plan is to use the really poor performing virtual machine from Hostitek to do some temporary hosting until I can get a virtual machine from Jumba.

Today I setup mail loops on the several virtual machines I purchased so that in total I have 3 mail servers. The domain I use for email is already setup for GeoIP with BIND so I figured I’d direct DNS to the nearest possible server using this technique, with the other servers also listed at a lower priority. This way I can ensure that many cross-continent emails are encrypted while they travel along the sea bed.

Today also migrated my Icecast hostings to the new platform I blogged about here.

Running Icecast on port 80

Running Icecast on port 80 is a good idea so that users behind corporate firewalls can still access your Icecast feed as you are not directing them to use non-standard ports.

However its not that easy since Icecast isn’t heavily audited for security faults and thus isn’t really setup to run on port 80.

Icecast should not run as root. Linux does not allow non-root users to bind to ports below 1024. So this is a problem.

The work around is to use iptables to redirect requests on port 80 to another port.

I used the following rules:

iptables -A PREROUTING -t nat –dst 8.8.8.8/32 -p tcp –dport 80 -j DNAT –to 8.8.8.8:8080

iptables -A INPUT -p tcp -m state –state NEW –dport 80 –dst 8.8.8.8/32 -j ACCEPT

New Android Market

It would appear that in the past few days Google have released a new Android market app.

The new app has a cleaner interface and integration with Google+ so that you can now +1 an app.

I had some troubles though when I first used the new market. Immediately needed to update 4 apps which then locked up my handset. After rebooting though things worked correctly.

Copying and pasting text in VIM

I use VIM all the type so thought I’d blog about this handy tip. Yes it is possible to copy and paste text in VIM and you don’t even need a mouse.

The command ‘Y’ or ‘yy’ copies (yanks) one or more lines.


Y – copy one line

2Y – copy two lines

10Y – copy 10 lines

yG – copy all lines to the end of the file

To paste the text contained in the buffer, uppercase P will paste at the current cursor position while lowercase p will paste below the current cursor position.

Google Translate doesn’t support HTTPS?

Working on some plugins for GLPI the past few days I’ve needed to translate some of their documentation as its in French. Their wiki is served from a web server that only supports HTTPS (SSL).

So I soon discovered that Google Translate doesn’t support HTTPS. Trying to translate a URL that is HTTPS results in an error page.

You’d think that ANY use of HTTP should include support for HTTPS. Great work Google!

Hostitek sucks

I’m cancelling the Los Angeles Virtual Private Server I got recently from Hostitek and blogged about here.

Reason is their disk I/O & network performance sucks. There is plenty of CPU and memory, but with bad disk I/O, its hard to ever use any of it.

So I’m replacing this VM with one from BuyVM in San Jose. So far seems better but costs a few bucks more.

I found their $12.95 plan, it was more cost effective to get the $5.95 plan and order an extra 50GB disk space for $5. The extra memory I don’t need.