URL Shortening with a Custom Domain

I’ve always thought that nothing says “I’m a twat” more than an obviously personalized car number plate. I guess the geek equivalent these days is your own custom short domain for URL shortening. Most people probably use bit.ly, goo.gl or one of the dozens of similar services that spang up to accommodate the character limit in Twitter Tweets. I’ve never liked the idea of such services, but I can see the reason Twitter doesn’t use a markup language for tweets, and that the 140 character limit is absolute, and you’re only allowed text.

I recently saw a tweet by Scott Hanselman that included a short link using the hnsl.mn domain,  and I thought, ‘how can I do that?’.

First you have a short domain registered.  There are lots of countries that have TLDs on the internet that they allow people to register for vanity purposes.  Some countries don’t allow this, so you’ll probably never be able to get a .om (for Oman)  short domain, but many others do.  I’ve ‘owned’ longsteve.com since the days of 2400bps modems and if you take the vowels out of longsteve, you get lngs.tv, which was available.  Some countries run their own domain registrar which you need to use for those domains.  For example, if you want a .st domain, you need to pay www.nic.st.  However, a .tv domain, from the Polynesian island nation of Tuvalu, can be bought from almost any registrar so I registered it with my regular hosting company.

Next I needed to look into the URL shortening service I was going to use.  I could probably roll my own using some PHP, and to be honest, and if I was looking to learn a bunch of stuff about URL handling and web services and so on, I certainly would have.  However, that’s not my thing at the moment, I just wanted something that would work, and bit.ly have a Pro service that is currently free, although you need to be accepted since it’s sort of still Beta.  They may decide to charge for it in the future, we’ll see.  Using the bit.ly Pro service, you perform some setup using your bit.ly account, and then point your domain at the primary IP address for bit.ly.  Once this is all done, you continue using your normal bit.ly service, but the URLs it give you use your custom domain.  All this is very neat and tidy, and it integrates with everything that already uses bit.ly (like the WordPress WP-To-Twitter plugin, the Echofon Twitter client, you name it!).

One small problem I encountered in doing all this was that in order to point your domain at bit.ly, you need to set up the DNS A Record for it.  Since I used my hosting company to register, the domain was pointing at their DNS server, but the tools they offered didn’t let me update the DNS in any way, only to point the domain at new DNS servers.  I contacted the support, and they were very helpful, but it turned out that I needed to have a paid hosting account with them, for the new short domain, before they would perform any DNS alterations.  The paid account I currently have is for my main longsteve.com domain, and requiring a separate one for the new domain is fair enough.  The cheapest paid account they offer is £20 a year, which is very reasonable, but I don’t need to pay for it in this case.

You can use a free DNS service which allows you to manage the DNS records for your domain yourself.   There are several on the Internet, but I chose AppsDNS after looking at a few.  FreeDNS looked very interesting, and they have a unique system that allows owners of domains to let anyone else register sub-domains under their domain for free, and use those to their own ends.  So, I could have put lngs.tv on FreeDNS, and you’d be able to register (for free) whateveryoulike.lngs.tv, and use that domain yourself.  I didn’t fancy doing that at the moment, but it’s an interesting service to browse around and look at the domains available for use.  Back to AppsDNS, if you’re managing 3 domains or less, their service is free, and after a simple sign up, all you need to do to use them is set the DNS data you’d like for your domain.  You simply uses your registrars domain setup system to point it at the DNS servers for AppsDNS.  Then you can enter all sorts of DNS records and info using the AppsDNS service.  It’s not for the faint of heart, but all you need for a bit.ly custom URL is to add an “A Record” pointing to the bit.ly IP address.  After doing this, and confirming all the domain details in the bit.ly settings interface, everything was ready to go.  It can sometimes take a day or two for DNS updates to propagate around the Internet, so don’t be worried if you’ve set everything up and bit.ly still can’t see your domain.  Just wait a day and try again.

So, now whenever I use bit.ly to shorten a URL, it uses my custom lngs.tv domain in the short URL.  Geeky, frivolous and it probably makes me look like a twat, but it was an interesting exercise, and I learnt a bit about DNS and Internet hosting along the way, so I’m not complaining.

Be Sociable, Share!

, , , , ,

3 Responses to URL Shortening with a Custom Domain

  1. SteveNo Gravatar May 14, 2011 at 11:38 am #

    I don’t think so no, DNS is about resolving host names to IP addresses. You could however use a name based virtual hosting feature in your web server, if you have enough control over it, to do what I think you’re talking about.

  2. SamayCSA May 13, 2011 at 1:02 am #

    Can you somehow use a DNS service, like an A record or something to redirect to a subfolder on a top level domain ? For example http://indiawebsearch.com/category/technology/vmware ?

Trackbacks/Pingbacks

  1. Fix My Bugs » URL Shortening with a Custom Domain | DNS Internet - April 18, 2011

    [...] rest is here: Fix My Bugs » URL Shortening with a Custom Domain Posted in and, at, dns, internet, is, it, KY, Make, net, no, not, this, Uncategorized, way | Tags: [...]

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word