DEV Community

Discussion on: What's DNS?

Collapse
 
ggenya132 profile image
Eugene Vedensky

Hey this is kind of awesome thanks for writing this. Question about CNAME: is the CNAME yet another shortcut to the ip? In other words, if I type in the CNAME into the browser, what's the process of resolving to one of those IPs look like. Does is resemble something like this data structure?

{
      'duckduckgo.com': {
        'www.duckduckgo.com': [
          '23.21.193.169',
          '107.20.240.232',
          '184.72.104.138'
        ]
      }
    }
Collapse
 
gabeguz profile image
Gabriel Guzman

Hi Eugene, exactly. A CNAME is basically a shortcut or an alias to an A record. A CNAME can't point directly to an IP address, it always points to another name.

CNAME:  myhost.duckduckgo.com -> A: www.duckduckgo.com
CNAME:  duckduckgo.com -> A: www.duckduckgo.com 
A: www.duckduckgo.com -> IP: 23.21.193.169', '107.20.240.232', '184.72.104.138

So, you can have any number of CNAMEs that point to any of your A records (or names) but not directly to an IP. A records point a name to an IP.