CNAME stands for Canonical Name for a domain. CNAME is an alias records that create association between a sub-domain and antother domain or subdomain.

And, A Record simply creates an association between a domain/sub-domain name and an IP Address.

Example CNAME
gallery.bala-krishna.com -> gallery.another-domain.com -> 64.1.236.65

you can see above CNAME require two DNS lookup to translate domain/subdomain to an IP Address. If client request for gallery.bala-krishna.com then DNS record will return gallery.another-domain.com then gallery.another-domain.com has to query DNS to translate gallery.another-domain.com into IP Address.

CNAME Record Syntax:
www? ? 14400? ? IN? ? CNAME? ? bala-krishna.com

Example A Record

gallery.another-domain.com -> 64.1.236.65

In case of gallery.another-domain.com, A record directly point to an IP Address so the DNS lookup directly returns IP Address to the client rather then domain/subdomain. hence only one DNS lookup required.

A Record Syntex:
ftp? ? ? ? 14400? ? IN? ? ? A? ? ? 67.159.45.3

Written by Bala Krishna

Bala Krishna is web developer and occasional blogger from Bhopal, MP, India. He like to share idea, issue he face while working with the code.

This article has 6 comments

  1. eWeb

    gallery.bala-krishna.com will point to 64.1.236.65. In other words, are we hiding real ip? & when do we need to practise this feature

  2. Latesha Mieras

    If you are planing on doing this from home keep in mind that your connection is likely asymmetrical. Meaning that your upload bandwidth is much less than your download bandwidth. This is great if you are browsing the net because most things are download. But if you are going to run any kind of VPN that slow upload will be the determining factor in overall speed. A VPN requires fast in and out. So a slow out will hamper it’s effectiveness. It’s going to be much more simple and effective to use a commercial personal vpn service like Aside from being fast the multiple server addresses will not get blocked by web filters like your home one will. However, if you really want to give it a shot then I would recommend OpenVPN It’s bullet proof and fast. You could set it up in a virtual machine on either computer and let it run in the background.

  3. dauwie

    great post … it is important to minimize these kind of requests … read the article “Minimize round-trip times / DNS lookups ” from google. Beste regards, Dauwie – webdesigner Gent

  4. Irina

    Hi!
    Thank you for the article, really nice, but I have some more question regarding DNS queries. Trying to find out how does it works, but still not clear 4me…

    I need to estimate queries for our web site. I know that 1st it will depend on TTL we set, but I have doubt regarding navigation between domains, and subdomains.

    For ex.: the user starts on DOMAIN.COM, then goes to DOMAIN.ES, then to SUB.DOMAIN.ES, then go to XDOMAIN.COM and finally GO.XDOMAIN.COM – will every call to domain/subdomain generate DNS query or it doesn’t matter when user navigates on our site between domains and subdomains? Couldn’t find a reply anywhere…

    Thank you beforehand for your time and reply

  5. seo company India

    I was suggested this website by my cousin. I
    am no longer positive whether this publish is written by him as no one else realize such special about my problem.
    You’re wonderful! Thank you!