Technology

CNAME Is Out; Hello ANAME!

Entry Updated: July 2nd, 2012

How familiar are you with DNS? Wikipedia states:

The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. A Domain Name Service resolves queries for these names into IP addresses for the purpose of locating computer services and devices worldwide. By providing a worldwide, distributed keyword-based redirection service, the Domain Name System is an essential component of the functionality of the Internet.

In simple terms, it is the address book system of the internet, converting human-friendly addresses (such as andrewallen.co.uk) in to computer-friendly IP addresses.

Ok, so you knew that much already. How familiar are you with DNS resource records?

Wikipedia continues:

A Resource Record (RR) is the basic data element in the domain name system. Each record has a type (A, MX, etc.), an expiration time limit, a class, and some type-specific data. Resource records of the same type define a resource record set (RRset). The order of resource records in a set, returned by a resolver to an application, is undefined, but often servers implement round-robin ordering to achieve Global Server Load Balancing. DNSSEC, however, works on complete resource record sets in a canonical order.

When dealing with a web site, there are two particular types of resource record that people mostly care about – the A record, which translates a hostname to an IP address, and the CNAME record, which allows you to alias one hostname to another.

How about the ANAME record? Ever heard of that before? Nope, neither did I until today.

For an increasing number of years, I’ve chosen to host all my domain zone files with DNS Made Easy – not only are they cost effective, but they guarantee 100% uptime across their geographically distributed IP Anycast network. When I moved my blog across to Amazon S3 / Amazon CloudFront from Posterous, I did do some research into whether I should also migrate to Amazon Route 53, Amazon’s own DNS service, however I found many comments showing people were actually seeing DNS Made Easy outperform all other similar service offerings, including Route 53.

Not only that, DNS Made Easy offer a number of other services, which simply isn’t offered anywhere else, and one such unique service announced today is the ANAME resource record type.

What is an ANAME record?

“DNS Made Easy are the first provider in the world to revolutionize the way DNS zones can be configured using the ANAME record”

Their words, not mine, however:

CNAME records cannot be created for the apex, or root record, of a domain. This is invalid based on DNS RFC’s, yet required in certain configurations.
CNAME records must be unique based on DNS RFC’s. Administrators can not create any other record type with the same name as a CNAME record or use multiple records in a round robin configuration. This is also required in certain configurations.
CNAME record resolution is slower based on the fact that they require a double lookup. Once to find the CNAME record itself, and a second to find the referred IP address.
What are the advantages?

When an ANAME record is created, DNS Made Easy internally monitored the fully qualified domain name (FQDN) of the IP address. We then create the associated A records that point to the IP address of the FQDN. When the IP address changes, the A records are updated immediately across all DNS Made Easy name servers.

ANAME records can be used as the root record for a domain as the resulting records created are A records which bypasses the limitation of allowing the alias at the root record.
Multiple ANAME records can be configured with the same name and all additional IP’s will be added in a round robin configuration in DNS Made Easy.
ANAME record speed up DNS performance as the correct IP address is returned on the first lookup rather than requiring multiple queries. Faster DNS lookups result in fast website load times which improves SEO.
So… what?

Just this evening I switched over a number of CNAME entries on andrewallen.co.uk, which currently reference Amazon S3 and CloudFront hostnames, over to ANAME records instead. When you now carry out a DNS lookup against http://www.andrewallen.co.uk, you’ll now see that instead of a CNAME redirection to an Amazon CloudFront hostname, A records of the resolved IP address for the CloudFront hostname are returned instead.

This means your client machine has had to carry out one less DNS lookup in order to resolve my site, so basically speeding up the whole process of viewing the site. In the world of user experience, response times are everything – that’s what Jakob Neilsen’s research shows anyway…

Update: July 2nd, 2012

Following a question posted in the comments by iwod, I developed a few further questions in my head about the service.

Depending on the type of DNS Made Easy account you purchase, you’ll be allocated a finite number of DNS queries that can be made against your zones – in my case, I have the business account and so allowed 10 millon queries per month, totalled across all my managed zones. I wondered, due to the nature of how ANAME records work, if this would impact the monthly query amount allocated to my account, as I have no control over how often the referenced hostname is checked? I can only control the TTL on my resource records, i.e. the resulting A records that are returned to lookups against my zone.

A reply back to this post from Richard at DNS Made Easy confirmed that…

“… ANAME records would not impact your monthly query count anymore than a CNAME would. In fact if you are creating a ANAME to another domain within DNS Made Easy it would actually save queries since there is no longer the requirement to do a double lookup.”

“There will be a minimal amount of checks against your domain if your target to your ANAME record is within DNS Made Easy, but nothing that should exceed a few thousand queries per month. This will generally save users on queries as well though since it would involve a double-lookup normally.”

The other query I had was around the use of ANAME records against my assigned Amazon CloudFront domain name. Once you’ve created a distribution within Amazon CloudFront, assigned the origins and setup the CNAME entries you want recognised against the distribution, you’ll then be assigned a unique domain name – you can then create a CNAME resource record against this within your own DNS zone.

As briefly mentioned, I have setup two CNAME resource records in my DNS Made Easy account:

static.andrewallen.co.uk, which references my website enabled Amazon S3 bucket (static.andrewallen.co.uk.s3-website-eu-west-1.amazonaws.com)
http://www.andrewallen.co.uk, which references my Amazon CloudFront domain name (d2pmvviymfwb5p.cloudfront.net)
When DNS Made Easy launched their ANAME resource records last week, I replaced both the above CNAME records with ANAME records instead – once updated, I could see that A record responses were now being returned, but I’ve now just noticed an unintended side effect.

I originally decided to use Amazon CloudFront because it can deliver my entire website, including dynamic, static and streaming content using a global network of edge locations – requests for content are automatically routed to the nearest edge location, so content is delivered with the best possible performance.

Because I have now switched to using ANAME records, when my referenced Amazon CloudFront domain name (d2pmvviymfwb5p.cloudfront.net) is resolved to an IP address by DNS Made Easy, the request is directed to the nearest edge location to the requester, i.e. nearest to the DNS Made Easy servers. The response is then stored to use for lookups against my zone, which won’t necessarily be the optimal location for everyone else – so in effect, all requests against my website are being directed to the same edge location, regardless of the requesters location, removing the effect and benefits of using Amazon CloudFront.

By carrying out a traceroute from my location in the UK, I am routed 17 hops to http://www.andrewallen.co.uk, with 100ms latency to the final hop, compared to 13 hops to d2pmvviymfwb5p.cloudfront.net, with 21ms latency to the final hop.

I’ve checked my AWS Usage Reports which also confirms the same – all traffic since the DNS update has been served out of the same region.

The end result appears that configuring ANAME records against a CDN provider such as Amazon CloudFront is not recommended, due to it not taking into consideration the latency based routing used to connect you to the nearest edge location. There are still benefits for using ANAME records against all other addresses not distributed through a content delivery network, such as a website enabled Amazon S3 bucket, as it will remove the extra lookup, as designed.

If ANAME records are to be useful alongside Amazon CloudFront, DNS Made Easy would have to recognise the various edge locations within Amazon’s Global Infrastructure, and adapt automatically on how those results are then returned.

For my own site, I’ve swapped the ANAME entry referencing my Amazon CloudFront domain name back to a CNAME resource record (www.andrewallen.co.uk), since overall lower latency is more important than the initial DNS lookup, but I have left in place the ANAME directly referencing my Amazon S3 bucket (static.andrewallen.co.uk).

Technology

Performance Analysis of Logs

If you’ve ever had to investigate an issue on a Windows box, apart from the Event Viewer, the other most common tool you’ve probably (and should have) used is Performance Monitor. However, it’s not uncommon that you don’t know which of the (potentially hundreds of) counters to collect, or even how to analyse the data, especially for particularly nasty or complicated issues with no clear indicators on where the problems lie.

Sometime around the beginning of 2011, I came across the Performance Analysis of Logs (PAL) Tool, which reads in a performance monitor counter log and analyzes it using known thresholds – it has since become one of the most useful utilities I keep in my tool box.

Key Features:

  • Thresholds files for most of the major Microsoft products such as IIS, MOSS, SQL Server, BizTalk, Exchange, and Active Directory.
  • An easy to use GUI interface, automatically creating batch files for the PAL.ps1 script.
  • A GUI editor for creating or editing your own threshold files.
  • Creates an HTML based report for ease of copy/pasting into other applications.
  • Analyzes performance counter logs using thresholds that change their criteria based on the computer’s role or hardware specs.
  • It’s a free, no cost utility!

Installation:

On the system to which you choose to use the tool, there are a number of pre-requisites to install first – I recommend you install PAL onto to your Windows 7 64-bit workstation (be aware that you don’t need to install PAL directly on the system which you want to monitor):

Once you’ve got all the pre-requisites installed, download the latest version of the Performance Analysis of Logs (PAL) Tool from the website – it’s actually quite small at only around 1MB in size. Unpack the Zip file, and run setup.exe, following any prompts to complete installation – if you’re still missing any requirements, you’ll be directed to the appropriate website automatically.

Something else to note – the installer will ‘Set-ExecutionPolicy’ for PowerShell to ‘Unrestricted’ to allow the included PowerShell scripts to be able to run, primarily the PAL.ps1 script.

Quick Start Guide:

It’s worth reading more about how to use the tool by digging around the site, or downloading the Intro to PAL video, but as a really quick start, run up the PAL application from the Start menu, switch to the ‘Threshold File’ tab, select ‘Quick System Overview’ from the ‘Threshold file title’ dropdown, then click ‘Export to Perfmon template file’. Copy the resulting XML file onto the system you want to monitor, import into Performance Monitor (hint: click ‘Start’, run and type ‘perfmon’ and press enter) as a new ‘Data Collection Set’, then set it running.

Once you’ve collected sufficient data for what ever length of time you feel appropriate, copy the performance logs (by default, in %systemdrive%\PerfLogs) back to your workstation, and re-launch PAL. Specify the ‘Counter Log Path’ on the ‘Counter Log’ tab, ensure you’ve selected ‘Quick System Overview’ on the ‘Threshold File’ tab, then jump to the ‘Execute’ tab and click ‘Finish’.

You’ll now see the PowerShell scripts kick in, as the resulting HTML report is generated – this will take some time, depending on the amount of data collected. By default, the report will be written to ‘[My Documents]\PAL Reports’, and you’re web browser will automatically open once the report generation is complete.

Scroll through the report, and you’ll see all kinds of alerts, recommendations, and graphs, analysing in detail the various performance counters that were monitored.

Sample Report:

If you have no time at all to try the tool out for yourself, download the Sample PAL Report, to understand what you’re missing out on.

Technology

Recover Your Lost Product Key

Another one for your tool kit… When you find yourself rebuilding a corrupt system, or just carrying out a straight-out rebuild, you’ve got all the install CDs, verified backups of your important data, found the storage driver disks, and… you can’t find the product key.

Not uncommon, especially if you’re rebuilding a system on someone else’s behalf. But over at NirSoft, among the many, many useful utilities is one called ProduKey.

ProduKey is a small utility that displays the ProductID and the CD-Key of Microsoft Office (Microsoft Office 2003, Microsoft Office 2007), Windows (Including Windows 7 and Windows Vista), Exchange Server, and SQL Server installed on your computer. You can view this information for your current running operating system, or for another operating system/computer – by using command-line options. This utility can be useful if you lost the product key of your Windows/Office, and you want to reinstall it on your computer.

There are a few different versions of the app available for download on the site, including 32-bit Zip64-bit Zip, and full installer versions – just download and run on your system of choice, and you’ll be able to ‘recover’ the product key that was used during installation of the operating system.

Taking it a little step further, I highly recommend you grap a copy of the NirLauncher, which is a complete package of all the NirSoft portable freeware utilities which you can just unpack to your local drive or favourite USB stick – you can even integrate the SysInternals Suite into the NirLauncher using the additional downloads available on the site.

Technology

Dillinger: Markdown Editor

Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz allowing people “to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)”. The language takes many cues from existing conventions for marking up plain text in email.

Put simply, Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

The goal for Markdown’s formatting syntax is to be as readable as possible. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

In short, you can create beautiful HTML documents without knowing any HTML.

Since switching my site over to Octopress, I’ve needed to write all the site content in Markdown syntax. While working at home on my Windows machine, I’ve been using MarkdownPad, which is a pretty good implementation (but could do with a spell check utility – hint!), but when I’m away from home, I needed someway of being able to write up new Markdown content while still being able to easily preview the output formatting.

While searching on Google, I came across an article on AddictiveTips, which highlighted the potential solution with Dillinger.

You only need to browse to http://dillinger.io/, and you can start using the tool straight away – one pretty nifty feature is the ability to save your documents straight into Dropbox. Also, any preference changes you make (such as adjusting the theme) is remembered, so there is no need to reconfigure the tool on each return visit.